Beispiel #1
0
 private void UpdateRuneStoneEmbedBtnsState()
 {
     if (SkillRuneManager.Instance.SkillRuneInfoDic.ContainsKey(this.currentSelectSkillID))
     {
         RunedStoneInfo runedStoneInfo = SkillRuneManager.Instance.SkillRuneInfoDic.get_Item(this.currentSelectSkillID);
         for (int i = 0; i < 4; i++)
         {
             if (runedStoneInfo.embedGroupId == i + 1)
             {
                 this.runeStoneEmbedBtnTransList.get_Item(i).FindChild("NoEmbedBtn").get_gameObject().SetActive(false);
                 this.runeStoneEmbedBtnTransList.get_Item(i).FindChild("haveEmbed").get_gameObject().SetActive(true);
             }
             else
             {
                 this.runeStoneEmbedBtnTransList.get_Item(i).FindChild("NoEmbedBtn").get_gameObject().SetActive(true);
                 this.runeStoneEmbedBtnTransList.get_Item(i).FindChild("haveEmbed").get_gameObject().SetActive(false);
             }
         }
     }
 }
 private void OnRuneStoneLoginPush(short state, RunedStoneLoginPush down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         for (int i = 0; i < down.stoneInfos.get_Count(); i++)
         {
             RunedStoneInfo runedStoneInfo = down.stoneInfos.get_Item(i);
             if (!this.skillRuneInfoDic.ContainsKey(runedStoneInfo.skillId))
             {
                 this.skillRuneInfoDic.Add(runedStoneInfo.skillId, runedStoneInfo);
             }
             else
             {
                 this.skillRuneInfoDic.set_Item(runedStoneInfo.skillId, runedStoneInfo);
             }
         }
         this.UpdateUnLockRuneStoneList();
     }
 }
    private void OnRuneStoneChangedNty(short state, RunedStoneChangedNty down = null)
    {
        if (state != 0)
        {
            StateManager.Instance.StateShow(state, 0);
            return;
        }
        if (down != null)
        {
            for (int i = 0; i < down.stoneInfos.get_Count(); i++)
            {
                RunedStoneInfo runedStoneInfo = down.stoneInfos.get_Item(i);
                switch (down.changeType)
                {
                case RunedStoneChangedNty.ChangeType.Add:
                    if (this.skillRuneInfoDic.ContainsKey(runedStoneInfo.skillId))
                    {
                        this.skillRuneInfoDic.set_Item(runedStoneInfo.skillId, runedStoneInfo);
                    }
                    else
                    {
                        this.skillRuneInfoDic.Add(runedStoneInfo.skillId, runedStoneInfo);
                    }
                    for (int j = 0; j < runedStoneInfo.runedStones.get_Count(); j++)
                    {
                        int runeStoneID = runedStoneInfo.runedStones.get_Item(j).cfgId;
                        if (this.newOpenRuneStones.ContainsKey(runedStoneInfo.skillId))
                        {
                            int num = this.newOpenRuneStones.get_Item(runedStoneInfo.skillId).FindIndex((int a) => a == runeStoneID);
                            if (num < 0)
                            {
                                this.newOpenRuneStones.get_Item(runedStoneInfo.skillId).Add(runeStoneID);
                            }
                        }
                        else
                        {
                            List <int> list = new List <int>();
                            list.Add(runeStoneID);
                            this.newOpenRuneStones.Add(runedStoneInfo.skillId, list);
                        }
                    }
                    break;

                case RunedStoneChangedNty.ChangeType.Update:
                    if (this.skillRuneInfoDic.ContainsKey(runedStoneInfo.skillId))
                    {
                        this.skillRuneInfoDic.set_Item(runedStoneInfo.skillId, runedStoneInfo);
                    }
                    break;

                case RunedStoneChangedNty.ChangeType.Remove:
                    if (this.skillRuneInfoDic.ContainsKey(runedStoneInfo.skillId))
                    {
                        this.skillRuneInfoDic.set_Item(runedStoneInfo.skillId, runedStoneInfo);
                    }
                    break;
                }
            }
            this.UpdateUnLockRuneStoneList();
            EventDispatcher.Broadcast(EventNames.OnRuneStoneChangedNty);
        }
    }