示例#1
0
    private static Node GetValidNode(Coord direction)
    {
        for (int i = 0; i < 3; i++)
        {
            direction.y = i == 0 ? 0 : (i == 1 ? 1 : -1);
            Node targetNode = NodeGrid.GetNeighbor(character.position, direction);
            if (targetNode != null)
            {
                return(targetNode);
            }
        }

        return(null);
    }