public void OnSkillTipsShow() { if (this.m_FormScript == null) { return; } GameObject gameObject = this.m_FormScript.transform.Find("SkillTipsBg").gameObject; if (!gameObject.activeSelf) { gameObject.CustomSetActive(true); } SkillSlotType[] array = new SkillSlotType[] { SkillSlotType.SLOT_SKILL_0, SkillSlotType.SLOT_SKILL_1, SkillSlotType.SLOT_SKILL_2, SkillSlotType.SLOT_SKILL_3 }; GameObject[] array2 = new GameObject[array.Length]; array2[0] = gameObject.transform.Find("Panel0").gameObject; array2[1] = gameObject.transform.Find("Panel1").gameObject; array2[2] = gameObject.transform.Find("Panel2").gameObject; array2[3] = gameObject.transform.Find("Panel3").gameObject; if (Singleton <GamePlayerCenter> .get_instance().GetHostPlayer() == null) { return; } PoolObjHandle <ActorRoot> captain = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().Captain; if (!captain) { return; } IHeroData heroData = CHeroDataFactory.CreateHeroData((uint)captain.get_handle().TheActorMeta.ConfigId); SkillSlot[] skillSlotArray = captain.get_handle().SkillControl.SkillSlotArray; for (int i = 0; i < array.Length; i++) { SkillSlot skillSlot = skillSlotArray[(int)array[i]]; array2[i].CustomSetActive(true); Skill skill; if (skillSlot != null) { skill = skillSlot.SkillObj; } else if (i < array.Length - 1 && i > 0) { skill = new Skill(captain.get_handle().TheActorMeta.ConfigId * 100 + i * 10); } else { skill = null; } if (skill != null) { Image component = array2[i].transform.Find("SkillMask/SkillImg").GetComponent <Image>(); if (component != null && !string.IsNullOrEmpty(skill.IconName)) { component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + skill.IconName, Singleton <CUIManager> .GetInstance().GetForm(CBattleHeroInfoPanel.s_battleHeroInfoForm), true, false, false, false); } Text component2 = array2[i].transform.Find("Text_Tittle").GetComponent <Text>(); if (component2 != null && skill.cfgData.szSkillName.get_Length() > 0) { component2.text = StringHelper.UTF8BytesToString(ref skill.cfgData.szSkillName); } Text component3 = array2[i].transform.Find("Text_CD").GetComponent <Text>(); int num = 0; if (skillSlot != null) { num = skillSlot.GetSkillCDMax(); } component3.text = ((i != 0) ? Singleton <CTextManager> .get_instance().GetText("Skill_Cool_Down_Tips", new string[] { (num / 1000).ToString() }) : Singleton <CTextManager> .get_instance().GetText("Skill_Common_Effect_Type_5")); if (i < array.Length && i > 0) { Text component4 = array2[i].transform.Find("Text_EnergyCost").GetComponent <Text>(); if (skillSlot == null) { component4.text = Singleton <CTextManager> .get_instance().GetText(EnergyCommon.GetEnergyShowText((uint)skill.cfgData.bEnergyCostType, EnergyShowType.CostValue), new string[] { skill.cfgData.iEnergyCost.ToString() }); } else { component4.text = Singleton <CTextManager> .get_instance().GetText(EnergyCommon.GetEnergyShowText((uint)skill.cfgData.bEnergyCostType, EnergyShowType.CostValue), new string[] { skillSlot.NextSkillEnergyCostTotal().ToString() }); } } ushort[] skillEffectType = skill.cfgData.SkillEffectType; for (int j = 1; j <= 2; j++) { GameObject gameObject2 = array2[i].transform.Find(string.Format("EffectNode{0}", j)).gameObject; if (j <= skillEffectType.Length && skillEffectType[j - 1] != 0) { gameObject2.CustomSetActive(true); gameObject2.GetComponent <Image>().SetSprite(CSkillData.GetEffectSlotBg(skillEffectType[j - 1]), this.m_FormScript, true, false, false, false); gameObject2.transform.Find("Text").GetComponent <Text>().text = CSkillData.GetEffectDesc(skillEffectType[j - 1]); } else { gameObject2.CustomSetActive(false); } } Text component5 = array2[i].transform.Find("Text_Detail").GetComponent <Text>(); ValueDataInfo[] actorValue = captain.get_handle().ValueComponent.mActorValue.GetActorValue(); if (component5 != null && skill.cfgData.szSkillDesc.get_Length() > 0) { component5.text = CUICommonSystem.GetSkillDesc(skill.cfgData.szSkillDesc, actorValue, skillSlot.GetSkillLevel(), captain.get_handle().ValueComponent.actorSoulLevel, (uint)captain.get_handle().TheActorMeta.ConfigId); } } else if (i == array.Length - 1) { Text component6 = array2[i].transform.Find("Text_Detail").GetComponent <Text>(); if (Singleton <BattleLogic> .GetInstance().GetCurLvelContext().IsMobaMode()) { component6.text = Singleton <CTextManager> .GetInstance().GetText("Skill_Text_Lock_PVP"); } else { component6.text = Singleton <CTextManager> .GetInstance().GetText("Skill_Text_Lock_PVE"); } } } }
private void RefreshHeroPropPanel(GameObject root, ref PoolObjHandle <ActorRoot> actor) { if (actor.get_handle() == null || actor.get_handle().ValueComponent == null) { return; } ValueDataInfo[] actorValue = actor.get_handle().ValueComponent.mActorValue.GetActorValue(); int soulLevel = actor.get_handle().ValueComponent.mActorValue.SoulLevel; uint configId = (uint)actor.get_handle().TheActorMeta.ConfigId; int actorMoveSpeed = actor.get_handle().ValueComponent.actorMoveSpeed; uint energyType = (uint)actor.get_handle().ValueComponent.mActorValue.EnergyType; Transform transform = root.transform; Text[] array = new Text[CBattleHeroInfoPanel.PropertyMaxAmount + 1u]; Text[] array2 = new Text[CBattleHeroInfoPanel.PropertyMaxAmount + 1u]; int num = 1; while ((long)num <= (long)((ulong)CBattleHeroInfoPanel.PropertyMaxAmount)) { array[num] = transform.Find(string.Format("TextL{0}", num)).GetComponent <Text>(); array2[num] = transform.Find(string.Format("TextR{0}", num)).GetComponent <Text>(); num++; } ResBattleParam anyData = GameDataMgr.battleParam.GetAnyData(); array[1].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_PhyAtkPt"); array2[1].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[1].basePropertyValue, (float)actorValue[1].extraPropertyValue); array[2].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MgcAtkPt"); array2[2].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[2].basePropertyValue, (float)actorValue[2].extraPropertyValue); array[3].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MaxHp"); array2[3].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[5].basePropertyValue, (float)actorValue[5].extraPropertyValue); array[4].text = Singleton <CTextManager> .GetInstance().GetText(EnergyCommon.GetEnergyShowText(energyType, EnergyShowType.MaxValue)); array2[4].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[32].basePropertyValue, (float)actorValue[32].extraPropertyValue); int totalValue = actorValue[3].totalValue; int percent = totalValue * 10000 / (totalValue + soulLevel * (int)anyData.dwM_PhysicsDefend + (int)anyData.dwN_PhysicsDefend); array[5].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_PhyDefPt"); array2[5].text = string.Format("{0}|{1}", CBattleHeroInfoPanel.GetFormStr((float)actorValue[3].basePropertyValue, (float)actorValue[3].extraPropertyValue), CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[3].extraPropertyValue > 0)); totalValue = actorValue[4].totalValue; percent = totalValue * 10000 / (totalValue + soulLevel * (int)anyData.dwM_MagicDefend + (int)anyData.dwN_MagicDefend); array[6].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MgcDefPt"); array2[6].text = string.Format("{0}|{1}", CBattleHeroInfoPanel.GetFormStr((float)actorValue[4].basePropertyValue, (float)actorValue[4].extraPropertyValue), CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[4].extraPropertyValue > 0)); totalValue = actorValue[28].totalValue; percent = 10000 * totalValue / (totalValue + soulLevel * (int)anyData.dwM_AttackSpeed + (int)anyData.dwN_AttackSpeed) + actorValue[18].totalValue; array[7].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_AtkSpdLvl"); array2[7].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[18].extraPropertyValue > 0); percent = actorValue[20].totalValue; array[8].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_CdReduce"); array2[8].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[20].extraPropertyValue > 0); totalValue = actorValue[24].totalValue; percent = 10000 * totalValue / (totalValue + soulLevel * (int)anyData.dwM_Critical + (int)anyData.dwN_Critical) + actorValue[6].totalValue; array[9].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_CritLvl"); array2[9].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[6].extraPropertyValue > 0); array[10].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MoveSpd"); array2[10].text = CBattleHeroInfoPanel.GetFormStr((float)(actorValue[15].basePropertyValue / 10), (float)((actorMoveSpeed - actorValue[15].basePropertyValue) / 10)); array[11].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_HpRecover"); totalValue = actorValue[16].totalValue; string text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_HpRecover_Desc"), totalValue); array2[11].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[16].basePropertyValue, (float)actorValue[16].extraPropertyValue); array[12].text = Singleton <CTextManager> .GetInstance().GetText(EnergyCommon.GetEnergyShowText(energyType, EnergyShowType.RecoverValue)); totalValue = actorValue[33].totalValue; string text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_EpRecover_Desc"), totalValue); array2[12].text = CBattleHeroInfoPanel.GetFormStr((float)actorValue[33].basePropertyValue, (float)actorValue[33].extraPropertyValue); array[13].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_PhyArmorHurt"); array2[13].text = string.Format("{0}|{1}", CBattleHeroInfoPanel.GetFormStr((float)actorValue[7].baseValue, (float)actorValue[7].extraPropertyValue), CBattleHeroInfoPanel.GetFormPercentStr(actorValue[34].totalValue, actorValue[34].extraPropertyValue > 0)); array[14].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MgcArmorHurt"); array2[14].text = string.Format("{0}|{1}", CBattleHeroInfoPanel.GetFormStr((float)actorValue[8].baseValue, (float)actorValue[8].extraPropertyValue), CBattleHeroInfoPanel.GetFormPercentStr(actorValue[35].totalValue, actorValue[35].extraPropertyValue > 0)); totalValue = actorValue[26].totalValue; percent = 10000 * totalValue / (totalValue + soulLevel * (int)anyData.dwM_PhysicsHemophagia + (int)anyData.dwN_PhysicsHemophagia) + actorValue[9].totalValue; array[15].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_PhyVampLvl"); array2[15].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[9].extraPropertyValue > 0); totalValue = actorValue[27].totalValue; percent = 10000 * totalValue / (totalValue + soulLevel * (int)anyData.dwM_MagicHemophagia + (int)anyData.dwN_MagicHemophagia) + actorValue[10].totalValue; array[16].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_MgcVampLvl"); array2[16].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[10].extraPropertyValue > 0); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(configId); if (dataByKey != null) { array[17].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_BaseAtkRange"); array2[17].text = Utility.UTF8Convert(dataByKey.szAttackRangeDesc); } else { array[17].text = string.Empty; array2[17].text = string.Empty; } totalValue = actorValue[29].totalValue; percent = 10000 * totalValue / (totalValue + soulLevel * (int)anyData.dwM_Tenacity + (int)anyData.dwN_Tenacity) + actorValue[17].totalValue; array[18].text = Singleton <CTextManager> .GetInstance().GetText("Hero_Prop_CtrlReduceLvl"); array2[18].text = CBattleHeroInfoPanel.GetFormPercentStr(percent, actorValue[17].extraPropertyValue > 0); }