Exemplo n.º 1
0
 public void ShowSummonSkills(PetDataEx petData, PetInfo petInfo = null)
 {
     if (petData != null)
     {
         this.mActiveSkillInfo = petData.GetPlayerSkillInfo();
         if (this.mActiveSkillInfo != null)
         {
             Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
             this.mActiveSkill.mainTexture = mainTexture;
         }
         else
         {
             this.mActiveSkill.mainTexture = null;
         }
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
     if (this.mPassiveSkills[0] != null && petData != null)
     {
         int i = 0;
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillInfos[i] = petData.GetSkillInfo(1 + j);
             if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0)
             {
                 this.mPassiveSkills[i].gameObject.SetActive(true);
                 if (j == 0 || (ulong)petData.Data.Further > (ulong)((long)(j + 1)))
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(false);
                     this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 else
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 i++;
             }
         }
         while (i < 3)
         {
             this.mPassiveSkillInfos[i] = null;
             this.mPassiveSkills[i].gameObject.SetActive(false);
             i++;
         }
     }
 }
Exemplo n.º 2
0
 public void Refresh(PetDataEx petData, bool isLeft = true)
 {
     this.isLeft = isLeft;
     if (petData != null)
     {
         this.mActiveSkillInfo = petData.GetPlayerSkillInfo();
         if (this.mActiveSkillInfo != null)
         {
             Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
             this.mActiveSkill.mainTexture = mainTexture;
             this.mSkillsLevel[0].text = Singleton<StringManager>.Instance.GetString("equipImprove36", new object[]
             {
                 this.mActiveSkillInfo.Level
             });
         }
         else
         {
             this.mActiveSkill.mainTexture = null;
         }
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
     if (this.mPassiveSkills[0] != null && petData != null)
     {
         int i = 0;
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillInfos[i] = petData.GetSkillInfo(1 + j);
             if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0)
             {
                 this.mPassiveSkills[i].gameObject.SetActive(true);
                 if (j == 0 || (ulong)petData.Data.Further > (ulong)((long)(j + 1)))
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillGreyIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                     this.mSkillsLevel[j + 1].text = Singleton<StringManager>.Instance.GetString("equipImprove36", new object[]
                     {
                         this.mPassiveSkillInfos[j].Level
                     });
                 }
                 else
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillGreyIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillGreyIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                     this.mSkillsLevel[j + 1].text = string.Empty;
                 }
                 i++;
             }
         }
         while (i < 3)
         {
             this.mPassiveSkillInfos[i] = null;
             this.mPassiveSkills[i].gameObject.SetActive(false);
             i++;
         }
     }
 }