コード例 #1
0
    void CollectLevelUp()
    {
        PlayerManager pm = Core.Data.playerManager;

        foreach (BattleSequence bsq in this.listdata)
        {
            BattleSyncData syncdata = bsq.sync;            // this.listdata[RewardAnimationIndex].sync;
            if (syncdata != null)
            {
                if (pm.Lv < syncdata.lv)
                {
                    if (Lvs.Count > 0)
                    {
                        if (Lvs[Lvs.Count - 1] < syncdata.lv)
                        {
                            Lvs.Add(syncdata.lv);
                        }
                    }
                    else
                    {
                        Lvs.Add(syncdata.lv);
                    }
                }
            }
            ComboReward comboReward = bsq.comboReward;
            if (comboReward != null)
            {
                ComboRewardCoin += bsq.comboReward.award;
            }
        }

        Lab_ComboRewardCoin.text = "+" + ComboRewardCoin.ToString();
    }
コード例 #2
0
    void OnPlayRewardAnimationFinished()
    {
        #region  步精力和钱经验
        BattleSyncData syncdata = this.listdata[RewardAnimationIndex].sync;
        PlayerManager  pm       = Core.Data.playerManager;

        if (syncdata != null)
        {
            pm.SetCurUserLevel(syncdata.lv);
            pm.RTData.curCoin   = syncdata.coin;
            pm.RTData.curExp    = syncdata.ep;
            pm.RTData.curJingLi = syncdata.eny;

            DBUIController.mDBUIInstance.RefreshUserInfo();
        }
        #endregion


        RewardAnimationIndex++;
        Vector3 pos  = uiPanel.transform.localPosition;
        Vector2 size = uiPanel.GetViewSize();
        if (RewardAnimationIndex < List_Elements.Count)
        {
            float cha = (RewardAnimationIndex + 1) * uiGrid.cellWidth - size.y - pos.y;
            if (cha > 0)
            {
                pos.y += cha;
                SpringPanel.Begin(uiPanel.gameObject, pos, 16f).onFinished = () =>
                {
                    List_Elements[RewardAnimationIndex].Play();
                };
            }
            else
            {
                List_Elements[RewardAnimationIndex].Play();
            }
        }
        else
        {
            float cha = RewardAnimationIndex * uiGrid.cellWidth + 240f - size.y - pos.y;
            if (cha > 0)
            {
                pos.y += cha;
                SpringPanel.Begin(uiPanel.gameObject, pos, 16f).onFinished = () =>
                {
                    SaoDangOK.SetActive(true);
                    OnSaoDangOKFinshed();
                };
            }
            else
            {
                SaoDangOK.SetActive(true);
                OnSaoDangOKFinshed();
            }
        }
    }
コード例 #3
0
 public void EnterField(int index, System.Action <bool> callback)
 {
     IsPushMsg = false;
     BattleSyncData.CleanUp();
     ScoreRankList.CleanUp();
     //Actioned = false;
     Api.EnterField(index, delegate(Hashtable payload)
     {
         if (payload != null)
         {
             FetchDataHandler(payload);
         }
         if (callback != null)
         {
             callback(payload != null);
         }
     });
 }