Пример #1
0
        void swap(Block a, Block b)
        {
            blockList[a._X, a._Y] = b;
            blockList[b._X, b._Y] = a;

            a.SetData();
            b.SetData();
        }
Пример #2
0
        void swap()
        {
            blockList[firBlock._X, firBlock._Y] = secBlock;
            blockList[secBlock._X, secBlock._Y] = firBlock;

            firBlock.SetData();
            secBlock.SetData();
        }
Пример #3
0
        public void InitializeBlock()
        {
            for (int x = 0; x < width; ++x)
            {
                //TODO : check match and reset color
                for (int y = 0; y < height; ++y)
                {
                    GameObject go = Instantiate(blockPrefab) as GameObject;
                    go.transform.parent        = transform;
                    go.name                    = "block";
                    go.transform.localPosition = new Vector2(x, y);

                    Block block = go.GetComponent <Block>();
                    blockList[x, y] = block;

                    block.SetData(x, y);
                }
            }
        }
Пример #4
0
        void swap(Block a, Block b)
        {
            blockList[a._X, a._Y] = b;
            blockList[b._X, b._Y] = a;

            a.SetData();
            b.SetData();
        }