Esempio n. 1
0
        protected override void OnLoadDataDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnLoad(this);
            if (UIEngineHelper.IsDataBind(PageStatus, this))
            {
                if (this.Model == null)
                {
                    this.Model = new ItemRefModel();
                }
                OnLoadConsumer(new InParameterModel[] {}, new InParameterModel[] {});
                OnLoadData(this);
                this.IsDataBinding = true;                  //加载完数据要绑定一次.目前加这.
            }
            else
            {
                if (this.UseQueryCase)
                {
                    UFIDA.UBF.Query.CommonService.RefQueryHelper.AfterOnLoad_Qry_DefaultImpl(this.Action);
                }
                //去除.已经移入到OnInit()中.
                //this.Model = (ItemRefModel)this.CurrentState[this.TaskId.ToString()];
            }
            adjust.ProcessAdjustAfterOnLoadData(this);
            AfterOnLoad();

            adjust.ProcessAdjustAfterOnLoad(this);
        }
Esempio n. 2
0
    public static void EnterCore(int picId, int sliceId)
    {
        // save status
        lastPicId   = picId;
        lastSliceId = sliceId;

        // hide bg and show core page
        UIEngine.HideFlaoting <BackgroundFloating>();

        UIEngineHelper.WateAdmissionComplete(() => {
            UIEngine.Forward <CorePage>();
        });

        // load picture which player select
        var picFile       = StaticDataLite.GetCell <string>("pic", picId.ToString(), "file");
        var contentSprite = PicLibrary.LoadContentSprite(picFile);

        // load slice info
        var piceSize = StaticDataLite.GetCell <int>("pice_slice", sliceId.ToString(), "cell_size");

        // test code
        // piceSize = 400;

        // start core game
        Puzzle.Instance.StartPuzzle(contentSprite, piceSize);

        // when compelte
        Puzzle.Instance.Complete += OnCoreGameCompelte;

        //LocalNotification.SendNotification(1, 5000, "Title", "Long message text", new Color32(0xff, 0x44, 0x44, 255));
    }
Esempio n. 3
0
 private void DoBack()
 {
     Puzzle.Instance.Clean();
     UIEngineHelper.WateAdmissionComplete(() => {
         UIEngine.BackTo <MainPage>();
         UIEngine.DestroyFromPool("LevelCompletePage");
     });
 }
Esempio n. 4
0
    public void OnGetButton()
    {
        if (SDKManager.IsAdLoaded)
        {
            SDKManager.ShowInterAd(clicked => {
                if (clicked)
                {
                    Helper.AddGold(40);
                    if (sources == AdPageOpenSources.Shop)
                    {
                        PlayerStatus.lastUseAtGiftTime = TimestampUtil.Now;
                    }
                    PlayerStatus.Save();

                    Log.Scrren("AdPage: clicked: " + clicked);
                    var admission = new Admission_PopdownOldPage();
                    UIEngine.Back(null, admission);
                    Compelte?.Invoke();
                    Compelte = null;
                }
                else
                {
                    var param       = new DialogParam();
                    param.des       = "您没有点击广告,需要点击广告才能获得金币";
                    param.button    = "确认";
                    var popup       = new Admission_PopupNewPage();
                    var dialog      = UIEngine.Forward <DialogPage>(param, popup);
                    dialog.Complete = result => {
                        Log.Scrren("AdPage: clicked: " + clicked);
                        UIEngineHelper.WateAdmissionComplete(() => {
                            var admission = new Admission_PopdownOldPage();
                            UIEngine.Back(null, admission);
                            Compelte?.Invoke();
                            Compelte = null;
                        });
                    };
                }
            });
        }
        else
        {
            var admission = new Admission_PopdownOldPage();
            UIEngine.Back(null, admission);
            Compelte?.Invoke();
            Compelte = null;
        }

        AudioManager.PlaySe("button");
    }
Esempio n. 5
0
    void OnItemUnlockButton(PictruePage_Item item)
    {
        var data = item.data;
        var cost = data.picRow.Get <int>("cost");
        var gold = PlayerStatus.gold;

        if (gold >= cost)
        {
            Debug.Log("can unlock");
            gold -= cost;
            PlayerStatus.gold = gold;
            var pictureId = data.picRow.Get <string>("id");
            LevelStorage.SetPictureUnlocked(pictureId);
            PlayerStatus.Save();

            // 单独处理需要修改显示状态的 item
            data.status = PicturePage_ItemStatus.Unlocked;
            SetItem(item, data);
            item.Flash();
            AudioManager.PlaySe("button");
            AudioManager.PlaySe("unlock-pic");
        }
        else
        {
            var param = new DialogParam();
            param.des    = MsgList.Get("lack_of_gold");
            param.button = "商城";
            var popup  = new Admission_PopupNewPage();
            var dialog = UIEngine.Forward <DialogPage>(param, popup);
            dialog.Complete = result => {
                if (result == DialogResult.Conform)
                {
                    UIEngineHelper.WateAdmissionComplete(() => {
                        UIEngine.Forward <ShopPage>();
                    });
                }
            };
            AudioManager.PlaySe("lack-of-gold");
        }
    }
Esempio n. 6
0
        protected override void OnLoadDataDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnLoad(this);
            if (UIEngineHelper.IsDataBind(PageStatus, this))
            {
                if (this.Model == null)
                {
                    this.Model = new LogViewerUIModel();
                }
                OnLoadConsumer(new InParameterModel[] {}, new InParameterModel[] {});
                OnLoadData(this);
                this.IsDataBinding = true;                  //加载完数据要绑定一次.目前加这.
            }
            else
            {
                //去除.已经移入到OnInit()中.
                //this.Model = (LogViewerUIModel)this.CurrentState[this.TaskId.ToString()];
            }
            adjust.ProcessAdjustAfterOnLoadData(this);
            AfterOnLoad();

            adjust.ProcessAdjustAfterOnLoad(this);
        }