示例#1
0
    // Get specific tile type
    public TileArrayObject.TileArrayType GetTileArrayType(Vector3 worldPosition)
    {
        TileArrayObject tileArrayObject = grid.GetGridObject(worldPosition);

        if (tileArrayObject != null)
        {
            return(tileArrayObject.GetTileArrayType());
        }
        else
        {
            return(new TileArrayObject.TileArrayType());
        }
    }
示例#2
0
    // Update display
    public void UpdateVisual(GridArray <TileArrayObject> grid)
    {
        HideNodeVisuals();

        for (int row = 0; row < grid.GetHeight(); row++)
        {
            for (int col = 0; col < grid.GetWidth(); col++)
            {
                TileArrayObject gridObject = grid.GetGridObject(row, col);

                Transform visualNode = visualNodeArray[row, col];
                visualNode.gameObject.SetActive(true);
                SetupVisualNode(visualNode, gridObject);
            }
        }
    }