コード例 #1
0
        public override void Awake()
        {
            base.Awake();

            var t = mDMono.transform;

            m_Container         = t.GetComponent <UIWidget>("Container");
            m_Icon              = t.GetComponent <DynamicUISprite>("Container/SkillDes/BG/SkillItem/Icon");
            m_SkillName         = t.GetComponent <UILabel>("Container/SkillDes/BG/NameLabel");
            m_SkillLevel        = t.GetComponent <UILabel>("Container/SkillDes/BG/SkillItem/Sprite/Level");
            m_SkillType         = t.GetComponent <UILabel>("Container/SkillDes/BG/SkillIconBG/Label");
            m_SkillTypeBG       = t.GetComponent <UISprite>("Container/SkillDes/BG/SkillIconBG");
            m_BG                = t.GetComponent <UISprite>("Container/SkillDes/BG");
            m_SkillFrame        = t.GetComponent <UISprite>("Container/SkillDes/BG/SkillItem");
            BGBaseHeight        = 440;
            m_Context           = t.GetComponent <UILabel>("Container/SkillDes/SkillDes");
            m_ContextAdditional = t.GetComponent <UILabel>("Container/SkillDes/SkillDescAdditional");
            SkillTargetLabelBG  = t.GetComponent <UISprite>("Container/SkillDes/BG/SkillTargetTypeBG");
            SkillTargetLabel    = t.GetComponent <UILabel>("Container/SkillDes/BG/SkillTargetTypeBG/Label");
            SkillCooldownLabel  = t.GetComponent <UILabel>("Container/SkillDes/BG/SkillTime/Label");
            BuffTemp            = t.GetMonoILRComponent <UISkillBuffTemplate>("Container/SkillDes/BuffTemplate");
            BuffTipObj          = t.FindEx("Container/SkillDes/BuffTip").gameObject;
            BuffParentTable     = t.GetComponent <UITable>("Container/SkillDes/BuffTip/BuffList/Placeholder/Table");
            BuffDropObj         = t.FindEx("Container/SkillDes/BuffTip/Drop").gameObject;
            BuffScrollView      = t.GetComponent <UIScrollView>("Container/SkillDes/BuffTip/BuffList");
        }
コード例 #2
0
        public void UpdateUI()
        {
            GetSkillData();
            if (m_SkillData == null)
            {
                return;
            }
            m_Icon.spriteName = m_SkillData.Icon;
            m_SkillName.text  = m_SkillData.Name;
            m_SkillLevel.text = skillLevel.ToString();
            //觉醒框显示,利用觉醒技能list查找
            SkillSetTool.SkillFrameStateSet(m_SkillFrame, Hotfix_LT.Data.CharacterTemplateManager.Instance.IsAwakenSkill(m_SkillData.ID));
            SetSkillType(m_SkillData.Type);
            SetSkillTargetLabel(m_SkillData.SelectTargetType);
            string cooldownStr = (m_SkillData.MaxCooldown > 0) ? (m_SkillData.MaxCooldown + EB.Localizer.GetString("ID_uifont_in_CombatHudV4_TurnFont_4")) : EB.Localizer.GetString("ID_SKILL_COOLDOWN_NOT");

            SkillCooldownLabel.text  = string.Format("{0}{1}", EB.Localizer.GetString("ID_SKILL_COOLDOWN"), cooldownStr);
            m_Context.text           = GetContext();
            m_ContextAdditional.text = LTPartnerSkillBreakController.GetSkillAdditional(m_SkillData.ID, skillLevel);

            int buffHeight = 0;

            if (m_SkillData.BuffDescribleID != null)
            {
                BuffTipObj.CustomSetActive(true);
                if (BuffTempList == null)
                {
                    BuffTempList = new List <UISkillBuffTemplate>();
                }
                for (int i = 0; i < BuffTempList.Count; i++)
                {
                    BuffTempList[i].Hide();
                }
                BuffDropObj.CustomSetActive(m_SkillData.BuffDescribleID.Count >= 3);
                for (int i = 0; i < m_SkillData.BuffDescribleID.Count; i++)
                {
                    var buff = Hotfix_LT.Data.BuffTemplateManager.Instance.GetTemplate(m_SkillData.BuffDescribleID[i]);
                    if (buff != null)
                    {
                        if (i >= BuffTempList.Count)
                        {
                            //新建buffTemp
                            UISkillBuffTemplate temp = Object.Instantiate(BuffTemp.mDMono, Vector3.zero, Quaternion.Euler(0, 0, 0), BuffParentTable.transform).transform.GetMonoILRComponent <UISkillBuffTemplate>();
                            temp.SetData(buff);
                            BuffTempList.Add(temp);
                        }
                        else
                        {
                            //复用buffTemp
                            BuffTempList[i].SetData(buff);
                        }
                        if (m_SkillData.BuffDescribleID.Count >= 3)
                        {
                            buffHeight = 525;
                        }
                        else
                        {
                            buffHeight += BuffTempList[i].GetBuffTempHeight() + 15;
                        }
                    }
                }
                BuffParentTable.Reposition();
                BuffScrollView.verticalScrollBar.value = 0;
            }
            else
            {
                BuffTipObj.CustomSetActive(false);
            }
            StartCoroutine(UpdatePos(buffHeight));
        }