private void InitHeroPanelInfo(uint uiObjId, Transform trHeroPanel, int iHeroTotalDamage, uint uiTotalDamage, bool bIsMaxTotalDamage, CHostHeroDamage objHostHeroDamage)
 {
     if (trHeroPanel == null || uiObjId == 0u)
     {
         return;
     }
     this.InitHeroPanelHeroInfo(uiObjId, trHeroPanel, objHostHeroDamage);
     this.InitHeroPanelSkillInfo(uiObjId, trHeroPanel, uiTotalDamage, objHostHeroDamage);
     this.InitHeroPanelTotalDamage(trHeroPanel, iHeroTotalDamage, (uiTotalDamage != 0u) ? ((float)iHeroTotalDamage / uiTotalDamage) : 1f, bIsMaxTotalDamage);
 }
        private void InitHeroPanelHeroInfo(uint uiObjId, Transform trHeroPanel, CHostHeroDamage objHostHeroDamage)
        {
            if (trHeroPanel == null || objHostHeroDamage == null)
            {
                return;
            }
            Transform transform = trHeroPanel.FindChild("PanelTop");

            if (transform)
            {
                int          num          = 0;
                string       text         = null;
                string       text2        = null;
                byte         b            = 0;
                byte         b2           = 0;
                ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num, ref b, ref b2))
                {
                    Transform transform2 = transform.FindChild("Imghead");
                    if (transform2)
                    {
                        Transform transform3 = transform2.FindChild("head");
                        if (transform3)
                        {
                            Image component = transform3.GetComponent <Image>();
                            if (component)
                            {
                                string prefabPath;
                                if (actorTypeDef == ActorTypeDef.Actor_Type_Hero)
                                {
                                    string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)num, 0u);
                                    prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + heroSkinPic;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Organ)
                                {
                                    prefabPath = KillNotify.building_icon;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Monster)
                                {
                                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(num);
                                    if (dataCfgInfoByCurLevelDiff != null && !string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon))
                                    {
                                        prefabPath = dataCfgInfoByCurLevelDiff.szBossIcon;
                                    }
                                    else if (b2 == 1)
                                    {
                                        prefabPath = KillNotify.monster_icon;
                                    }
                                    else if (b == 7 || b == 9)
                                    {
                                        prefabPath = KillNotify.dragon_icon;
                                    }
                                    else if (b == 8)
                                    {
                                        prefabPath = CHostHeroDeadInfo.m_strDragonBig;
                                    }
                                    else
                                    {
                                        prefabPath = KillNotify.yeguai_icon;
                                    }
                                }
                                else
                                {
                                    prefabPath = KillNotify.monster_icon;
                                }
                                component.SetSprite(prefabPath, this.m_heroDeadInfoForm, true, false, false, false);
                            }
                        }
                    }
                    Transform transform4 = transform.FindChild("heroName");
                    if (transform4)
                    {
                        Text component2 = transform4.GetComponent <Text>();
                        if (component2)
                        {
                            string text3 = text;
                            if (!string.IsNullOrEmpty(text3))
                            {
                                int    num2  = text3.IndexOf('(');
                                string text4 = text3.Substring(num2 + 1, text3.get_Length() - num2 - 2);
                                component2.text = text4;
                            }
                        }
                    }
                    Transform transform5 = transform.FindChild("playerName");
                    if (transform5)
                    {
                        Text component3 = transform5.GetComponent <Text>();
                        if (component3)
                        {
                            if (!string.IsNullOrEmpty(text2))
                            {
                                component3.text = text2;
                                transform5.gameObject.CustomSetActive(true);
                            }
                            else
                            {
                                transform5.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                }
            }
        }
        private void InitHeroPanelSkillInfo(uint uiObjId, Transform trHeroPanel, uint uiTotalDamge, CHostHeroDamage objHostHeroDamage)
        {
            DOUBLE_INT_INFO[] array = new DOUBLE_INT_INFO[12];
            objHostHeroDamage.GetActorDamage(uiObjId, ref array);
            SkillSlot skillSlot = null;

            for (int i = 0; i < 3; i++)
            {
                string    name      = "PanelSkill/Skill" + i;
                Transform transform = trHeroPanel.FindChild(name);
                if (transform)
                {
                    if (array[i].iValue <= 0)
                    {
                        transform.gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        transform.gameObject.CustomSetActive(true);
                        skillSlot = null;
                        PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .get_instance().GetActor(uiObjId);

                        if (array[i].iKey < 10 && actor && actor.get_handle().SkillControl != null)
                        {
                            if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && array[i].iKey > 0)
                            {
                                actor.get_handle().SkillControl.TryGetSkillSlot((SkillSlotType)array[i].iKey, out skillSlot);
                            }
                            else if (actor.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
                            {
                                actor.get_handle().SkillControl.TryGetSkillSlot((SkillSlotType)array[i].iKey, out skillSlot);
                            }
                        }
                        Transform transform2 = transform.FindChild("ImgSkill");
                        if (transform2)
                        {
                            Image component = transform2.GetComponent <Image>();
                            if (component)
                            {
                                if (skillSlot != null)
                                {
                                    if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                                    {
                                        component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + skillSlot.SkillObj.IconName, this.m_heroDeadInfoForm, true, false, false, false);
                                    }
                                    else
                                    {
                                        component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + "1001", this.m_heroDeadInfoForm, true, false, false, false);
                                    }
                                }
                                else if (array[i].iKey == 10)
                                {
                                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + "1106", this.m_heroDeadInfoForm, true, false, false, false);
                                }
                                else
                                {
                                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + "1001", this.m_heroDeadInfoForm, true, false, false, false);
                                }
                            }
                        }
                        int skillSlotHurtType = objHostHeroDamage.GetSkillSlotHurtType(uiObjId, (SkillSlotType)array[i].iKey);
                        if (skillSlotHurtType >= 0 && skillSlotHurtType < 4)
                        {
                            Transform transform3 = transform.FindChild("TxtSkillTypeBg");
                            if (transform3)
                            {
                                Image component2 = transform3.GetComponent <Image>();
                                if (component2)
                                {
                                    component2.SetSprite("UGUI/Sprite/Common/" + CHostHeroDeadInfo.m_Skill_HurtType_Bg_ImgName[skillSlotHurtType], this.m_heroDeadInfoForm, true, false, false, false);
                                }
                            }
                            Transform transform4 = transform.FindChild("TxtSkillType");
                            if (transform4)
                            {
                                Text component3 = transform4.GetComponent <Text>();
                                if (component3)
                                {
                                    component3.text  = this.m_Skill_HurtType_Name[skillSlotHurtType];
                                    component3.color = CUIUtility.s_Text_Skill_HurtType_Color[skillSlotHurtType];
                                }
                            }
                            Transform transform5 = transform.FindChild("TxtSkillName");
                            if (transform5)
                            {
                                Text component4 = transform5.GetComponent <Text>();
                                if (component4)
                                {
                                    if (skillSlot != null)
                                    {
                                        component4.text = skillSlot.SkillObj.cfgData.szSkillName;
                                    }
                                    else
                                    {
                                        ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                                        if (!actor)
                                        {
                                            int          num           = 0;
                                            string       text          = null;
                                            string       text2         = null;
                                            ActorTypeDef actorTypeDef2 = ActorTypeDef.Invalid;
                                            byte         b             = 0;
                                            byte         b2            = 0;
                                            if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num, ref b, ref b2))
                                            {
                                                actorTypeDef = actorTypeDef2;
                                            }
                                        }
                                        else
                                        {
                                            actorTypeDef = actor.get_handle().TheActorMeta.ActorType;
                                        }
                                        if (actorTypeDef == ActorTypeDef.Actor_Type_Hero)
                                        {
                                            if (array[i].iKey == 0)
                                            {
                                                component4.text = this.m_strAtkSkill0Name;
                                            }
                                            else if (array[i].iKey == 10)
                                            {
                                                component4.text = this.m_strHeroEquipSkillName;
                                            }
                                            else
                                            {
                                                component4.text = this.m_strHeroPassiveSkillName;
                                            }
                                        }
                                        else
                                        {
                                            component4.text = this.m_strAtkSkill0Name;
                                        }
                                    }
                                    component4.color = CUIUtility.s_Text_SkillName_And_HurtValue_Color[skillSlotHurtType];
                                }
                            }
                            float     value      = (uiTotalDamge != 0u) ? ((float)array[i].iValue / uiTotalDamge) : 1f;
                            Transform transform6 = transform.FindChild("Damage");
                            if (transform6)
                            {
                                for (int j = 0; j < 4; j++)
                                {
                                    Transform transform7 = transform6.FindChild(CHostHeroDeadInfo.m_Skill_HurtValue_Bg_ImgName[j]);
                                    if (transform7)
                                    {
                                        transform7.gameObject.CustomSetActive(j == skillSlotHurtType);
                                        if (j == skillSlotHurtType)
                                        {
                                            Image component5 = transform7.GetComponent <Image>();
                                            if (component5)
                                            {
                                                component5.CustomFillAmount(value);
                                            }
                                        }
                                    }
                                }
                            }
                            Transform transform8 = transform.FindChild("TxtDamageValue");
                            if (transform8)
                            {
                                Text component6 = transform8.GetComponent <Text>();
                                if (component6)
                                {
                                    string text3 = string.Concat(new object[]
                                    {
                                        array[i].iValue,
                                        "(",
                                        value.ToString("P0"),
                                        ")"
                                    });
                                    component6.text  = text3;
                                    component6.color = CUIUtility.s_Text_SkillName_And_HurtValue_Color[skillSlotHurtType];
                                }
                            }
                        }
                    }
                }
            }
        }
        private void InitHeroPanelSkillInfo(uint uiObjId, Transform trHeroPanel, uint uiTotalDamge, CHostHeroDamage objHostHeroDamage)
        {
            int num = 0;

            HURT_INFO[] array = new HURT_INFO[12];
            objHostHeroDamage.GetActorDamage(uiObjId, ref array, ref num);
            for (int i = 0; i < 3; i++)
            {
                string    name      = "PanelSkill/Skill" + i;
                Transform transform = trHeroPanel.FindChild(name);
                if (transform)
                {
                    if (array[i].iValue <= 0)
                    {
                        transform.gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        transform.gameObject.CustomSetActive(true);
                        PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .instance.GetActor(uiObjId);

                        Transform transform2 = transform.FindChild("ImgSkill");
                        if (transform2)
                        {
                            Image component = transform2.GetComponent <Image>();
                            if (component)
                            {
                                if (array[i].strIconName != null)
                                {
                                    if (array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_SKILL || array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_AREATRIGGER)
                                    {
                                        component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + array[i].strIconName, this.m_heroDeadInfoForm, true, false, false, false);
                                    }
                                    else if (array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_EQUIP)
                                    {
                                        component.SetSprite(CUIUtility.s_Sprite_System_BattleEquip_Dir + array[i].strIconName, this.m_heroDeadInfoForm, true, false, false, false);
                                    }
                                }
                                else if (array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_EQUIP)
                                {
                                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + "1106", this.m_heroDeadInfoForm, true, false, false, false);
                                }
                                else
                                {
                                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + "1001", this.m_heroDeadInfoForm, true, false, false, false);
                                }
                            }
                        }
                        HurtTypeDef hurtType = array[i].hurtType;
                        if (hurtType >= HurtTypeDef.PhysHurt && hurtType < HurtTypeDef.Max)
                        {
                            Transform transform3 = transform.FindChild("TxtSkillTypeBg");
                            if (transform3)
                            {
                                Image component2 = transform3.GetComponent <Image>();
                                if (component2)
                                {
                                    component2.SetSprite("UGUI/Sprite/Common/" + CHostHeroDeadInfo.m_Skill_HurtType_Bg_ImgName[(int)hurtType], this.m_heroDeadInfoForm, true, false, false, false);
                                }
                            }
                            Transform transform4 = transform.FindChild("TxtSkillType");
                            if (transform4)
                            {
                                Text component3 = transform4.GetComponent <Text>();
                                if (component3)
                                {
                                    component3.set_text(this.m_Skill_HurtType_Name[(int)hurtType]);
                                    component3.set_color(CUIUtility.s_Text_Skill_HurtType_Color[(int)hurtType]);
                                }
                            }
                            Transform transform5 = transform.FindChild("TxtSkillName");
                            if (transform5)
                            {
                                Text component4 = transform5.GetComponent <Text>();
                                if (component4)
                                {
                                    if (array[i].strName != null)
                                    {
                                        component4.set_text(array[i].strName);
                                    }
                                    else
                                    {
                                        ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                                        if (!actor)
                                        {
                                            int          num2          = 0;
                                            string       text          = null;
                                            string       text2         = null;
                                            ActorTypeDef actorTypeDef2 = ActorTypeDef.Invalid;
                                            byte         b             = 0;
                                            byte         b2            = 0;
                                            if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num2, ref b, ref b2))
                                            {
                                                actorTypeDef = actorTypeDef2;
                                            }
                                        }
                                        else
                                        {
                                            actorTypeDef = actor.handle.TheActorMeta.ActorType;
                                        }
                                        if (actorTypeDef == ActorTypeDef.Actor_Type_Hero)
                                        {
                                            if (array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_SKILL)
                                            {
                                                component4.set_text(this.m_strAtkSkill0Name);
                                            }
                                            else if (array[i].SkillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_EQUIP)
                                            {
                                                component4.set_text(this.m_strHeroEquipSkillName);
                                            }
                                            else
                                            {
                                                component4.set_text(this.m_strHeroPassiveSkillName);
                                            }
                                        }
                                        else
                                        {
                                            component4.set_text(this.m_strAtkSkill0Name);
                                        }
                                    }
                                    component4.set_color(CUIUtility.s_Text_SkillName_And_HurtValue_Color[(int)hurtType]);
                                }
                            }
                            float     value      = (uiTotalDamge == 0u) ? 1f : ((float)array[i].iValue / uiTotalDamge);
                            Transform transform6 = transform.FindChild("Damage");
                            if (transform6)
                            {
                                for (int j = 0; j < 4; j++)
                                {
                                    Transform transform7 = transform6.FindChild(CHostHeroDeadInfo.m_Skill_HurtValue_Bg_ImgName[j]);
                                    if (transform7)
                                    {
                                        transform7.gameObject.CustomSetActive(j == (int)hurtType);
                                        if (j == (int)hurtType)
                                        {
                                            Image component5 = transform7.GetComponent <Image>();
                                            if (component5)
                                            {
                                                component5.CustomFillAmount(value);
                                            }
                                        }
                                    }
                                }
                            }
                            Transform transform8 = transform.FindChild("TxtDamageValue");
                            if (transform8)
                            {
                                Text component6 = transform8.GetComponent <Text>();
                                if (component6)
                                {
                                    string text3 = string.Concat(new object[]
                                    {
                                        array[i].iValue,
                                        "(",
                                        value.ToString("P0"),
                                        ")"
                                    });
                                    component6.set_text(text3);
                                    component6.set_color(CUIUtility.s_Text_SkillName_And_HurtValue_Color[(int)hurtType]);
                                }
                            }
                        }
                    }
                }
            }
        }