コード例 #1
0
 private void PlaceMetaTile(MetaTileMap metaTileMap, Vector3Int position, MetaTile metaTile)
 {
     foreach (LayerTile tile in metaTile.GetTiles())
     {
         metaTileMap.RemoveTile(position, tile.LayerType);
         metaTileMap.SetTile(position, tile, cells[0].matrix);
     }
 }
コード例 #2
0
 private void PlaceLayerTile(Vector3Int position, LayerTile tile, Matrix4x4 matrixTransform)
 {
     if (!_importMode)
     {
         _metaTileMap.RemoveTile(position, tile.LayerType);
     }
     SetTile(position, tile, matrixTransform);
 }
コード例 #3
0
    private void RpcRemoveTile(Vector3 position, LayerType layerType, bool onlyRemoveEffect)
    {
        if (onlyRemoveEffect)
        {
            position.z = -1;
        }

        metaTileMap.RemoveTile(position.RoundToInt(), layerType, !onlyRemoveEffect);
    }
コード例 #4
0
    private void InternalRemoveTile(Vector3 position, LayerType layerType, bool onlyRemoveEffect)
    {
        if (onlyRemoveEffect)
        {
            position.z = -1;
        }

        Vector3Int p = position.RoundToInt();

        metaTileMap.RemoveTile(p, layerType, !onlyRemoveEffect);
    }
コード例 #5
0
    public override void BoxErase(GridLayout grid, GameObject layer, BoundsInt area)
    {
        MetaTileMap metaTileMap = grid.GetComponent <MetaTileMap>();

        foreach (Vector3Int position in area.allPositionsWithin)
        {
            if (metaTileMap)
            {
                metaTileMap.RemoveTile(position, false);
            }
            else
            {
                layer.GetComponent <Layer>().SetTile(position, null, Matrix4x4.identity, Color.white);
            }
        }
    }
コード例 #6
0
        public override void BoxErase(GridLayout grid, GameObject layer, BoundsInt area)
        {
            MetaTileMap metaTileMap = grid.GetComponent <MetaTileMap>();

            foreach (Vector3Int position in area.allPositionsWithin)
            {
                if (metaTileMap)
                {
                    metaTileMap.RemoveTile(position, LayerType.None);
                }
                else
                {
                    layer.GetComponent <Tilemap>().SetTile(position, null);
                }
            }
        }
コード例 #7
0
    private void InternalUpdateTile(Vector3Int position, TileType tileType, string tileName,
                                    Matrix4x4?transformMatrix = null, Color?color = null)
    {
        LayerTile layerTile = TileManager.GetTile(tileType, tileName);

        metaTileMap.SetTile(position, layerTile, transformMatrix, color);
        //if we are changing a tile at z=0, make sure to remove any overlays it has as well

        //TODO: OVERLAYS - right now it only removes at z = -1, but we will eventually need
        //to allow multiple overlays on a given location which would require multiple z levels.
        if (layerTile.TileType != TileType.UnderFloor)
        {
            if (position.z == 0)
            {
                position.z = -1;
                if (metaTileMap.HasTile(position, layerTile.LayerType, true))
                {
                    metaTileMap.RemoveTile(position, layerTile.LayerType);
                }
            }
        }
    }
コード例 #8
0
 private void PlaceLayerTile(MetaTileMap metaTileMap, Vector3Int position, LayerTile tile)
 {
     metaTileMap.RemoveTile(position, tile.LayerType);
     SetTile(metaTileMap, position, tile);
 }
コード例 #9
0
    private void InternalRemoveTile(Vector3 position, LayerType layerType, bool removeAll)
    {
        Vector3Int p = position.RoundToInt();

        metaTileMap.RemoveTile(p, layerType, removeAll);
    }