示例#1
0
    private void CreateNewBlock()
    {
        var materials = colorsDatabase.GetRandom();

        if (nextBlock == null)
        {
            nextBlock = FlyingBlock.Constract(blocksDatabase.GetRandom(), materials.Item1, materials.Item2, grid);
        }

        currentBlock = nextBlock;
        currentBlock.gameObject.SetActive(true);
        currentBlock.transform.SetParent(grid.transform);
        currentBlock.transform.localPosition = new Vector3(4, 22);

        materials = colorsDatabase.GetRandom();
        nextBlock = FlyingBlock.Constract(blocksDatabase.GetRandom(), materials.Item1, materials.Item2, grid);
        blockRenderer.CaptureBlock(nextBlock);
        nextBlock.gameObject.SetActive(false);
    }