Stairs.GetDestinationFloor C# (CSharp) Method

GetDestinationFloor() public method

public GetDestinationFloor ( ) : int
return int
    public int GetDestinationFloor()
    {
        // if the destination is above us, we go to the floor above, and vice versa
        return (destination.transform.position.y > transform.position.y) ? (floor + 1) : (floor - 1);
    }