示例#1
0
        public void RotateCubes()
        {
            if (CubeDataManager.Instance.UpdateLock)
            {
                return;
            }

            List <int> cubeIndex = new List <int>();

            for (int i = 0; i < currentControlCubes.Length; i++)
            {
                cubeIndex.Add(currentControlCubes[i].GetComponent <GameTileView>().Index);
            }

            for (int i = 0; i < currentControlCubes.Length; i++)
            {
                int newIndex = 0;

                if (i == 0)
                {
                    newIndex = cubeIndex[cubeIndex.Count - 1];
                }
                else
                {
                    newIndex = cubeIndex[i - 1];
                }

                GameTileView view = currentControlCubes[i].GetComponent <GameTileView>();
                view.UpdateTartgetPosition(VectorUtility.MinusPosition(PositionUtils.TransIndexToPosition(view.Index), PositionUtils.TransIndexToPosition(newIndex)));
                view.Index = newIndex;
            }

            changeDirectBufferTime = 0;
        }
 public void AddView(GameTileView view)
 {
     gameTileViews.Add(view);
 }