Ejemplo n.º 1
0
        public override void OnEnter(IBosServiceCollection context)
        {
            if (!IsOnEntered)
            {
                SetStage(START_STAGE);

                if (!isDialogShowed)
                {
                    isDialogShowed = true;

                    context.Execute(() => {
                        context.ViewService.Show(ViewType.TutorialDialogView,
                                                 () => { return(IsStandardDialogCondition(context)); },
                                                 (go) => { /* UnityEngine.Debug.Log($"view {go.name} is showed")*/ },
                                                 new ViewData {
                            UserData = new TutorialDialogData {
                                Texts = context.ResourceService.Localization.GetString("lbl_tut_11").WrapToList(),
                                OnOk  = () => {
                                    context.TutorialService.CreateFinger(kPositionMiniGames, new TutorialFingerData {
                                        Id = kPositionMiniGames,
                                        IsTooltipVisible = false,
                                        Position         = Vector2.zero
                                    });
                                }
                            }
                        });
                    }, 5);
                }
                IsOnEntered = true;
            }
        }
Ejemplo n.º 2
0
 public override void OnEnter(IBosServiceCollection context)
 {
     if (!IsOnEntered)
     {
         if (!isDialogShowed)
         {
             isDialogShowed = true;
             context.Execute(() => {
                 context.ViewService.Show(ViewType.TutorialDialogView,
                                          () => {
                     return((context.ViewService.ModalCount == 0) && (context.ViewService.LegacyCount == 0) &&
                            (!context.ViewService.Exists(ViewType.TutorialDialogView)));
                 },
                                          (viewObj) => { },
                                          new ViewData {
                     UserData = new TutorialDialogData {
                         Texts = context.ResourceService.Localization.GetString("lbl_tut_19").WrapToList(),
                         OnOk  = () => {
                             context.TutorialService.CreateFinger(kMegaBoostPosition, new TutorialFingerData {
                                 Id = kMegaBoostPosition,
                                 IsTooltipVisible = true,
                                 Position         = Vector2.zero,
                                 TooltipPosition  = new Vector2(-196, -95),
                                 TooltipScale     = new Vector3(1.34f, 1.34f, 1),
                                 TooltipText      = context.ResourceService.Localization.GetString("lbl_tut_20"),
                                 TooltipWidth     = 500,
                                 Timeout          = 7
                             });
                         }
                     }
                 });
             }, 1f);
         }
         IsOnEntered = true;
     }
 }
Ejemplo n.º 3
0
        public ShowUpgradeEfficiencyState(IBosServiceCollection services)
        {
            this.services = services;

            AddLocked(FINGER_ON_UPGRADE_ROLLBACK_BUTTON, new List <string> {
                "currency", "account", "garage", "office", "close", "slide", "addeff", "stuff"
            });
            AddLocked(FINGER_ON_UPGRADE_EFFICIENCY_BUTTON, new List <string> {
                "currency", "account", "garage", "office", "close", "slide", "addrollback", "stuff"
            });

            TutorialStageObservable.Subscribe(stage => {
                switch (stage)
                {
                case DIALOG_FIRST: {
                    services.ExecuteWhen(() => {
                            ForceTutorialDialog(services, new TutorialDialogData {
                                Texts = new List <string> {
                                    services.ResourceService.Localization.GetString("lbl_tut_55")
                                },
                                OnOk = () => {
                                    SetStage(FINGER_ON_UPGRADE_ROLLBACK_BUTTON);
                                }
                            });
                        }, () => IsValid(services));
                }
                break;

                case FINGER_ON_UPGRADE_ROLLBACK_BUTTON: {
                    services.Execute(() => {
                            services.TutorialService.CreateHighlightRegion(rollbackHighlightParams);
                            Finger(services, rollbackFingerPosition, 20);
                            int nextRollbackLevel = services.ManagerService.GetNextRollbackLevel(managerId: 0);
                            var coins             = services.ResourceService.ManagerImprovements.GetRollbackImproveData(level: nextRollbackLevel).CoinsPrice;
                            services.PlayerService.AddCoins(coins);
                        }, 0.5f);
                }
                break;

                case FINGER_ON_UPGRADE_EFFICIENCY_BUTTON: {
                    services.Execute(() => {
                            services.TutorialService.CreateHighlightRegion(efficiencyHighlightParams);
                            Finger(services, efficiencyFingerPosition, 20);
                            int nextEfficiencyLevel = services.ManagerService.GetNextEfficiencyLevel(0);
                            var coins = services.ResourceService.ManagerImprovements.GetEfficiencyImproveData(nextEfficiencyLevel).CoinsPrice;
                            services.PlayerService.AddCoins(coins);
                        }, 1);
                }
                break;

                case END_DIALOG: {
                    ForceTutorialDialog(services, new TutorialDialogData {
                            Texts = new List <string> {
                                services.ResourceService.Localization.GetString("lbl_tut_56")
                            },
                            OnOk = () => {
                                SetCompleted(services, true);
                            }
                        });
                }
                break;
                }
            }).AddTo(services.Disposables);
        }