OpenDoor.ForB C# (CSharp) Method

ForB() public method

judge the player whether is front of the door or not
public ForB ( ) : void
return void
    void ForB()
    {
        Vector3 forward = transform.TransformDirection(Vector3.forward);
        Vector3 toOther = transform.position - player.transform.position;

        if (Vector3.Dot(forward, toOther) > 0)
            isFront = false;
        else
            isFront = true;
    }