Ejemplo n.º 1
0
 public override void OnEnter(IBosServiceCollection context) {
     this.services = context;
     if(!IsOnEntered ) {
         if (Stage == 0) {
             context.RunCoroutine(ShowFingerOnRickshawCountButtonImpl());
             SetStage(STAGE_WAIT_CLICK);
         }
         IsOnEntered = true;
     }
 }
Ejemplo n.º 2
0
        public override void OnEvent(IBosServiceCollection context, TutorialEventData eventData)
        {
            if (IsActive)
            {
                if (eventData.EventName == TutorialEventName.ViewHided)
                {
                    ViewType viewType = (ViewType)eventData.UserData;
                    if (viewType == ViewType.TransferWarningView)
                    {
                        isTransferWarningClosed = true;
                        if (Stage == DIALOG_SECOND_STAGE)
                        {
                            context.RunCoroutine(ShowHighlightWhenClosedTransferWarning(context));
                        }
                    }
                }

                if (eventData.EventName == TutorialEventName.ViewOpened)
                {
                    ViewType viewType = (ViewType)eventData.UserData;
                    if (viewType == ViewType.ProfileView)
                    {
                        context.TutorialService.RemoveFinger("profile");
                    }
                }

                if (Stage == SHOW_FINGER_ON_TRANSFER_TAB)
                {
                    if (eventData.EventName == TutorialEventName.TransferTabOpened)
                    {
                        context.TutorialService.RemoveFinger("transfer_tab");
                        context.ViewService.Show(ViewType.TutorialDialogView, new ViewData {
                            UserData = new TutorialDialogData {
                                Texts = new List <string> {
                                    context.ResourceService.Localization.GetString("lbl_tut_25"),
                                    context.ResourceService.Localization.GetString("lbl_tut_26")
                                },
                                OnOk = () => {
                                    SetStage(NEED_SHOW_LEGAL_TRANSFER);
                                }
                            }
                        });
                        context.TutorialService.RemoveHighlightRegion();
                    }
                }


                if (Stage == FINGER_ON_PROFILE_SHOWED_STAGE)
                {
                    if (eventData.EventName == TutorialEventName.TransferTabOpened)
                    {
                        //this code moved in NEED_SHOW_LEGAL_TRANSFER
                    }
                }
                else if (Stage == WAIT_FOR_LEGAL_TRANSFER)
                {
                    if (eventData.EventName == TutorialEventName.LegalTransferCompleted)
                    {
                        context.TutorialService.RemoveFinger("legal");
                        Finger(context, "illegal", 100);
                        SetStage(WAIT_FOR_FIRST_ILLEGAL_TRANSFER);
                    }
                }
                else if (Stage == WAIT_FOR_FIRST_ILLEGAL_TRANSFER)
                {
                    if (eventData.EventName == TutorialEventName.IllegalTransferCompleted)
                    {
                        context.TutorialService.RemoveFinger("illegal");
                        Finger(context, "illegal", 100);
                        SetStage(WAIT_FOR_SECOND_ILLEGAL_TRANSFER);
                    }
                }
                else if (Stage == WAIT_FOR_SECOND_ILLEGAL_TRANSFER)
                {
                    if (eventData.EventName == TutorialEventName.IllegalTransferCompleted)
                    {
                        context.TutorialService.RemoveFinger("illegal");

                        SetStage(DIALOG_SECOND_STAGE);

                        /////
                        ///
                    }
                }
                else if (Stage == WAIT_FOR_OPEN_STATUS_GOODS)
                {
                    if (eventData.EventName == TutorialEventName.StatusGoodsOpened)
                    {
                        context.TutorialService.RemoveFinger("status_goods");

                        SetStage(DIALOG_THIRD_STAGE);

                        /////////////////
                        //SetStage(WAIT_FOR_PURCHASE_PERSONAL_PRODUCT);
                        //context.RunCoroutine(ShowFingerOnBuyPersonalProduct());
                    }
                }
                else if (Stage == WAIT_FOR_PURCHASE_PERSONAL_PRODUCT)
                {
                    if (eventData.EventName == TutorialEventName.PersonalProductPurchased)
                    {
                        context.TutorialService.RemoveFinger("buy_product");
                        CompleteSelf(context);
                        //UDBG.Log($"complete self state => {IsCompleted}");
                        context.RunCoroutine(WaitForComplete());
                    }
                }
            }
        }
Ejemplo n.º 3
0
 protected void FingerDelayed(IBosServiceCollection context, string positionName, string tooltipText,
                              Vector2 tooltipPosition, float tooltipScale, float tooltipWidth, float timeout = -1, Action onShow = null)
 {
     context.RunCoroutine(FingerDelayedImpl(context, positionName, tooltipText, tooltipPosition, tooltipScale, tooltipWidth, timeout, onShow));
 }