コード例 #1
0
    public 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);
    }
コード例 #2
0
    private void InternalUpdateTile(Vector3 position, TileType tileType, string tileName)
    {
        LayerTile layerTile = TileManager.GetTile(tileType, tileName);

        if (tileType == TileType.WindowDamaged)
        {
            position.z -= 1;
        }

        Vector3Int p = position.RoundToInt();

        metaTileMap.SetTile(p, layerTile);
    }
コード例 #3
0
 private void PlaceMetaTile(MetaTileMap metaTileMap, Vector3Int position, MetaTile metaTile)
 {
     foreach (LayerTile tile in metaTile.GetTiles())
     {
         //metaTileMap.RemoveTileWithlayer(position, tile.LayerType);
         metaTileMap.SetTile(position, tile, cells[0].matrix, isPlaying: false);
     }
 }
コード例 #4
0
 private void SetTile(MetaTileMap metaTileMap, Vector3Int position, LayerTile tile)
 {
     foreach (LayerTile requiredTile in tile.RequiredTiles)
     {
         SetTile(metaTileMap, position, requiredTile);
     }
     metaTileMap.SetTile(position, tile, cells[0].matrix, cells[0].color);
 }
コード例 #5
0
        private void SetTile(Vector3Int position, LayerTile tile, Matrix4x4 matrixTransform)
        {
            foreach (LayerTile requiredTile in tile.RequiredTiles)
            {
                SetTile(position, requiredTile, matrixTransform);
            }

            _metaTileMap.SetTile(position, tile, matrixTransform);
        }
コード例 #6
0
    private void InternalUpdateTile(Vector3Int position, TileType tileType, string tileName)
    {
        LayerTile layerTile = TileManager.GetTile(tileType, tileName);

        metaTileMap.SetTile(position, layerTile);
        //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 (position.z == 0)
        {
            position.z = -1;
            if (metaTileMap.HasTile(position, layerTile.LayerType, true))
            {
                metaTileMap.RemoveTile(position, layerTile.LayerType);
            }
        }
    }
コード例 #7
0
    public void AddElectricalNode(Vector3Int position, WireConnect wireConnect)
    {
        var metaData = metaDataLayer.Get(position, true);
        var newdata  = new ElectricalMetaData();

        newdata.Initialise(wireConnect, metaData, position, this);
        metaData.ElectricalData.Add(newdata);

        ElectricalCableTile Tile = null;
        string Compound;

        if (newdata.InData.WireEndA < newdata.InData.WireEndB)
        {
            Compound = newdata.InData.WireEndA + "_" + newdata.InData.WireEndB;
        }
        else
        {
            Compound = newdata.InData.WireEndB + "_" + newdata.InData.WireEndA;
        }
        int spriteIndex = WireDirections.GetSpriteIndex(Compound);

        switch (newdata.InData.Categorytype)
        {
        case PowerTypeCategory.StandardCable:
            Tile = ElectricalManager.Instance.MediumVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.LowVoltageCable:
            Tile = ElectricalManager.Instance.LowVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.HighVoltageCable:
            Tile = ElectricalManager.Instance.HighVoltageCables.Tiles[spriteIndex];
            break;
        }
        newdata.RelatedTile = Tile;
        if (Tile != null)
        {
            if (metaTileMap != null)
            {
                metaTileMap.SetTile(position, Tile);
            }
        }
    }
コード例 #8
0
    private void RpcUpdateTile(Vector3 position, TileType tileType, string tileName)
    {
        LayerTile layerTile = TileManager.GetTile(tileType, tileName);

        if (tileType == TileType.Damaged)
        {
            position.z -= 1;
        }

        metaTileMap.SetTile(position.RoundToInt(), layerTile);
    }
コード例 #9
0
    public 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))
                {
                    metaTileMap.RemoveTileWithlayer(position, layerTile.LayerType);
                }
            }
        }
    }
コード例 #10
0
    private void InternalUpdateTile(Vector3 position, TileType tileType, string tileName)
    {
        LayerTile layerTile = TileManager.GetTile(tileType, tileName);

        metaTileMap.SetTile(position.RoundToInt(), layerTile);
    }