Ejemplo n.º 1
0
    private void CreateCityHallBlock()
    {
        if (!Settings.blocksTypeLibrary.ContainsKey(Settings.Blocks_types.CITY_HALL))
        {
            Debug.Log("Cityhall block data chybí v databázi ");
            return;
        }

        _newBlock = BlockFactory.CreateSymBlock(Settings.defaultWorldPosition, new Vector3(),
                                                Settings.blocksTypeLibrary[Settings.Blocks_types.CITY_HALL], null);

        var bConstructor = BlockFactory.BlockConstructor((SymBlock)_newBlock);

        _newBlock.ConstructBlock(bConstructor);
        _newBlock.ConstructBlockPost(bConstructor);

        _newBlock.BlocksMainGraphics.gameObject.SetActive(true);
    }
Ejemplo n.º 2
0
    public SymBlock CreateNewSymBlock(Vector3 position, Vector3 rotation, BlockSO BlockData, BlockChecker lastActiveChecker)
    {
        _newBlock = (SymBlock)BlockFactory.CreateSymBlock(position, rotation, BlockData, lastActiveChecker);

        var newBlock = (SymBlock)_newBlock;

        var bConstructor = BlockFactory.BlockConstructor((SymBlock)newBlock);

        bool wasBlockConstructed = newBlock.ConstructBlock(bConstructor);

        if (!wasBlockConstructed)
        {
            Debug.LogError("Symetricý blok se nepodařilo vytvořit!");
        }

        newBlock.SetBlockOrientation();

        newBlock.ConstructBlockPost(bConstructor);

        return((SymBlock)_newBlock);
    }