public override void Execute()
        {
            var gameModel = GetModel <IGameModel>();

            ILUIKit.GetPanel <UITetrisPanel>()
            .ShowRankUI(gameModel.Score.Value, gameModel.HighScore.Value, gameModel.NumbersGame.Value);
        }
示例#2
0
        //方块落下来了
        public void FallDown()
        {
            currentShape = null;

            var tetrisPanel = ILUIKit.GetPanel <UITetrisPanel>();

            var gameModel = mControllerNode.GetModel <IGameModel>();

            if (gameModel.isDataUpdate)
            {
                tetrisPanel.UpdateGameUI(gameModel.Score.Value, gameModel.HighScore.Value);
            }

            foreach (Transform t in blockHolder)
            {
                if (t.childCount <= 1)
                {
                    Object.Destroy(t.gameObject);
                }
            }

            if (gameModel.IsGameOver())
            {
                PauseGame();
                tetrisPanel.ShowGameOverUI(gameModel.Score.Value);
            }
        }
示例#3
0
        void OnStart()
        {
            UIKit.Root.SetResolution(640, 1136, 1);

            ResKit.Init();

            ILUIKit.OpenPanel <UITetrisPanel>();
        }
示例#4
0
        public override void Execute()
        {
            SendCommand <PlayCursorSoundCommand>();

            ILUIKit.GetPanel <UITetrisPanel>()
            .DoBeforeLeavingPlay();

            SendCommand(new EnteringMenuCommand());
        }
示例#5
0
 void OnStart()
 {
     // Code Here
     RankButton.onClick.AddListener(() => SendCommand(new OnRankButtonClickCommand()));
     SettingButton.onClick.AddListener(() =>
     {
         AudioKit.PlaySound("Cursor_002");
         ILUIKit.GetPanel <UITetrisPanel>()
         .SettingUI.Show();
     });
     StartButton.onClick.AddListener(() => SendCommand(new StartGameCommand()));
 }
        public override void Execute()
        {
            var panel = ILUIKit.GetPanel <UITetrisPanel>();

            panel.LogoName.Show();
            panel.LogoName.DOAnchorPosY(-160.3f, 0.5f);
            panel.MenuUI.Show();
            (panel.MenuUI.transform as RectTransform)
            .DOAnchorPosY(66.64f, 0.5f);

            SendCommand(new CameraZoomOutCommand(panel.MainCamera));
        }
示例#7
0
        private void InputControl()
        {
            var tetrisPanel = ILUIKit.GetPanel <UITetrisPanel>();

            //if (isSpeedup) return;
            float h = 0;

            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                h = -1;
            }
            else if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                h = 1;
            }

            if (h != 0)
            {
                Vector3 pos = transform.position;
                pos.x += h;
                transform.position = pos;
                if (tetrisPanel.Model.IsValidMapPosition(this.transform) == false)
                {
                    pos.x -= h;
                    transform.position = pos;
                }
                else
                {
                    mControllerNode.SendCommand <PlayControllerSoundCommand>();
                }
            }

            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                transform.RotateAround(pivot.position, Vector3.forward, -90);
                if (tetrisPanel.Model.IsValidMapPosition(this.transform) == false)
                {
                    transform.RotateAround(pivot.position, Vector3.forward, 90);
                }
                else
                {
                    mControllerNode.SendCommand <PlayControllerSoundCommand>();
                }
            }

            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                isSpeedup = true;
                stepTime /= multiple;
            }
        }
示例#8
0
        public override void Execute()
        {
            var tetrisPanel = ILUIKit.GetPanel <UITetrisPanel>();
            var model       = this.GetModel <IGameModel>();

            SendCommand <PlayCursorSoundCommand>();

            tetrisPanel.LogoName.DOAnchorPosY(160.4f, 0.5f)
            .OnComplete(() => tetrisPanel.LogoName.Hide());
            (tetrisPanel.MenuUI.transform as RectTransform)
            .DOAnchorPosY(-66.64f, 0.5f)
            .OnComplete(() => tetrisPanel.MenuUI.Hide());
            tetrisPanel.DoBeforeEnteringPlay();

            tetrisPanel.ShowGameUI(model.Score.Value, model.HighScore.Value);

            SendCommand(new CameraZoomInCommand(tetrisPanel.MainCamera));

            tetrisPanel.gameManager.StartGame();
        }
示例#9
0
        private void Fall()
        {
            var tetrisPanel = ILUIKit.GetPanel <UITetrisPanel>();

            Vector3 pos = transform.position;

            pos.y -= 1;
            transform.position = pos;
            if (tetrisPanel.Model.IsValidMapPosition(transform) == false)
            {
                pos.y += 1;
                transform.position = pos;
                isPause            = true;
                bool isLineclear = tetrisPanel.Model.PlaceShape(this.transform);
                if (isLineclear)
                {
                    mControllerNode.SendCommand <PlayLineClearSoundCommand>();
                }
                gameManager.FallDown();
                return;
            }

            mControllerNode.SendCommand <PlayDropSoundCommand>();
        }
 public override void Execute()
 {
     ILUIKit.GetPanel <UITetrisPanel>().Model.ClearData();
     SendCommand(new OnRankButtonClickCommand());
 }