public void RpcAddBlock(int x, int y, int z, MapBlock.BlockType type, Direction direction)
    {
        if (isServer)
        {
            return;
        }

        var pos   = new Vector3Int(x, y, z);
        var block = new MapBlock();

        block.Type      = type;
        block.Direction = direction;
        MapController.Instance.AddBlock(pos, block);
    }
Exemple #2
0
        public MapBlockController FindBlockPrefabWithType(MapBlock.BlockType type)
        {
            foreach (var block in blockPrefabs)
            {
                if (block == null)
                {
                    continue;
                }

                if (block.Block.Type == type)
                {
                    return(block);
                }
            }

            return(null);
        }