コード例 #1
0
    private void TryRebuildPath(PathfindingNode currentNode, Vector2 endingIndex)
    {
        Vector2 currentNodePosition = currentNode.gameObject.transform.position;
        Vector2 currentNodeIndex    = mapData.Get_IndexFromTilePosition(currentNodePosition);

        if (currentNodeIndex == endingIndex)
        {
            // REBUILD PATH HERE
        }
    }
コード例 #2
0
    private bool SetMovingLocation()
    {
        bool movingLocationSet = false;

        Vector2 destinationTilePos = clickInfo.Get_TilePositionClicked();
        bool    tilePosFound       = destinationTilePos != NO_TILE_POS_FOUND;

        if (tilePosFound)
        {
            Vector2 indexOfTile    = mapData.Get_IndexFromTilePosition(destinationTilePos);
            bool    tileIndexFound = indexOfTile != NO_INDEX_FOUND;

            if (tileIndexFound)
            {
                endingIndex       = indexOfTile;
                movingLocationSet = true;
            }
        }

        return(movingLocationSet);
    }