예제 #1
0
    public NodeBehaviour GetNextNode(PassageDirection direction)
    {
        if (direction == PassageDirection.Up)
        {
            return(up);
        }
        else if (direction == PassageDirection.Donw)
        {
            return(down);
        }
        else if (direction == PassageDirection.Left)
        {
            return(left);
        }
        else if (direction == PassageDirection.Right)
        {
            return(right);
        }

        return(null);
    }
예제 #2
0
    public bool CheckCanMove(PassageDirection direction)
    {
        if (direction == PassageDirection.Up && up != null)
        {
            return(true);
        }
        else if (direction == PassageDirection.Donw && down != null)
        {
            return(true);
        }
        else if (direction == PassageDirection.Left && left != null)
        {
            return(true);
        }
        else if (direction == PassageDirection.Right && right != null)
        {
            return(true);
        }

        return(false);
    }
예제 #3
0
 public void MovimentCurrentNode(PassageDirection direction)
 {
     currentNode = currentNode.GetNextNode(direction);
 }
예제 #4
0
 public bool CheckCanMove(PassageDirection direction)
 {
     return(currentNode.CheckCanMove(direction));
 }