Exemple #1
0
        public void StartGame(Player player, RuleSettings selectedRuleset, FtueController ftueController, SessionScript sessionScript, OverlayUISceneActivator overlayUISceneActivator, bool shouldShowHintTip)
        {
            print("[FTUE] Sixth ftue game started ");

            InterfaceController.Instance.Hide(GameWindow.MainMenu);
            GameplayScript      gameplay            = sessionScript.CreateGameAndStart(player, selectedRuleset);
            BoardCreationScript boardCreationScript = gameplay.GetComponent <BoardCreationScript>();

            InterfaceController.Instance.Show(GameWindow.ToolbarUI);

            if (shouldShowHintTip)
            {
                SceneActivationBehaviour <ToolbarUIActivator> .Instance.HintButtonScript.FtueForceHintOn();

                InterfaceController.Instance.Show(GameWindow.OverlayUIScene);
                SceneActivationBehaviour <TopBarUIActivator> .Instance.SetButtons(false);

                boardCreationScript.BlockAllCells();

                overlayUISceneActivator.ShowFtueGameplayMessage(GameConstants.Ftue.SixthGame.FtueMessages.Instructions6_1, true, false, 0, false, 1, false);

                SceneActivationBehaviour <ToolbarUIActivator> .Instance.ShowHandAnimation(true, GameConstants.Ftue.SixthGame.HandAnimations.Hand6_1);

                ftueController.SendFtueProgress("Game6UseHint_42");

                overlayUISceneActivator.SubscribeHintTap(() =>
                {
                    ftueController.SendFtueProgress("CantUndo_43");
                    overlayUISceneActivator.HideFtueMessages();

                    SceneActivationBehaviour <ToolbarUIActivator> .Instance.ShowHandAnimation(false);
                    SceneActivationBehaviour <ToolbarUIActivator> .Instance.ForceHintFtue(new Vector2(4, 2));

                    StartCoroutine(WaitForHintAnimation(() =>
                    {
                        overlayUISceneActivator.ShowFtueGameplayMessage(GameConstants.Ftue.SixthGame.FtueMessages.Instructions6_2, true, true, 0, true, 0, false);

                        overlayUISceneActivator.SubscribeForFullScreenTap(() =>
                        {
                            ftueController.PersistHintTipUse(player);

                            overlayUISceneActivator.ftueMessagesPerStage = 0;
                            gameplay.StartDelayedSession(true);

                            boardCreationScript.UnblockAllCells();

                            overlayUISceneActivator.HideFtueMessages();

                            gameplay.OnPuzzleSolved += gameData =>
                            {
                                int i = int.Parse(gameData.Ruleset.Id);
                                ftueController.ProceedToGameOverAward(player, i);

                                ftueController.SendFtueProgress("Game6Complete_44");
                            };
                        });
                    }));
                });
            }
            else
            {
                SceneActivationBehaviour <TopBarUIActivator> .Instance.SetButtons(false);

                overlayUISceneActivator.ftueMessagesPerStage = 0;
                gameplay.StartDelayedSession(true);
                boardCreationScript.UnblockAllCells();

                gameplay.OnPuzzleSolved += gameData =>
                {
                    int i = int.Parse(gameData.Ruleset.Id);
                    ftueController.ProceedToGameOverAward(player, i);

                    ftueController.SendFtueProgress("Game6Complete_44");
                };
            }
        }