示例#1
0
    void Start()
    {
        nowblock = Instantiate(main.tetris0, new Vector3(0, 0, 0), Quaternion.identity);
        CBlock cblock = nextblock.GetComponent <CBlock>();

        cblock.SetBlocks_Gen();
        cblock.SetBlocks_DISPLAY(false);
        cblock.SetBlocks_TYPE(999);
        for (int i = 0; i < 3; ++i)
        {
            Generating_Block(UID.next_x, UID.next_y, Block_Z);
            Save_BlockArr();
            //NextBlockArr();
        }
    }
示例#2
0
    public void Generating_Block(float _x, float _y, float _z)
    {
        int _order = main.GetBlockOrder();

        if (_order == 0)
        {
            nextblock = Instantiate(main.tetris0, new Vector3(_x - 0.3f, _y - 0.2f, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 1)
        {
            nextblock = Instantiate(main.tetris1, new Vector3(_x, _y, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 2)
        {
            nextblock = Instantiate(main.tetris2, new Vector3(_x, _y - 0.3f, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 3)
        {
            nextblock = Instantiate(main.tetris3, new Vector3(_x, _y, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 4)
        {
            nextblock = Instantiate(main.tetris4, new Vector3(_x, _y, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 5)
        {
            nextblock = Instantiate(main.tetris5, new Vector3(_x, _y, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
        if (_order == 6)
        {
            nextblock = Instantiate(main.tetris6, new Vector3(_x, _y, _z), Quaternion.identity);
            CBlock cblock = nextblock.GetComponent <CBlock>();
            cblock.SetBlocks_Gen();
            cblock.SetBlocks_DISPLAY(true);
            cblock.SetBlocks_TYPE(_order);
        }
    }