Пример #1
0
        public virtual void SetData(UListHeroTalentData item)
        {
            TalentIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_GAMEWAITINGROOMVIEW, 1, item.nTalentIconId);
            TalentIconImage.ResetToDefaultMaterial();
            TalentNameText.ResetToDefaultMaterial();
            TalentDescText.ResetToDefaultMaterial();
            TalentKeyText.ResetToDefaultMaterial();
            if (TalentIconImage.sprite == null) // 空的话给个默认的
            {
                TalentIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_GAMEWAITINGROOMVIEW, 1, 3, 4);
            }

            string sTalentDesc = item.sTalentDesc;
            string sTalentName = item.sTalentName;

            UBBProperty.GetInstance().getRatio(sTalentDesc);
            U3D_Render.Common.UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);
            // 此处需要再转换一下,不然PASD标签不能正确解析
            U3D_Render.Common.UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);

            U3D_Render.Common.UBB.toHtml(ref sTalentName, UBB_FORMAT_TYPE.UGUI);

            TalentDescText.text = sTalentDesc;
            UseTypeText.text    = item.sUseTypeDesc;
            TalentNameText.text = sTalentName;
            TalentKeyText.text  = "Ctrl+" + item.nSortIndex;
            Item = item;

            bActive = LogicDataCenter.heroTalentDataManager.isActivedThisTalent(item.nTalentId);
            ActiveObject.SetActive(bActive);

            if (NoActiveLockObject != null)
            {
                NoActiveLockObject.SetActive(item.bLock);
            }

            // 前置天赋未激活
            bTermActive = LogicDataCenter.heroTalentDataManager.isActivedThisTalent(item.nTalentTermId);
            ActiveObject.SetActive(bActive);

            if (item.nTalentTermId > 0 && !bTermActive)
            {
                TalentDescText.text = sTalentDesc + "(前置天赋未激活)";
                TalentIconImage.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentNameText.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentDescText.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentKeyText.AddNewMaterial(EUIShaderType.EST_Gray);
            }

            bCanActive = LogicDataCenter.heroTalentDataManager.isCanActiveTalent(item.nTalentId, item.nTalentLevel);

            // 推荐图标
            if (RecommandImage != null)
            {
                if (Item.bRecommand)
                {
                    RecommandImage.gameObject.SetActive(true);
                }
                else
                {
                    RecommandImage.gameObject.SetActive(false);
                }
            }

            #region 新手引导部分
            if (item.bUseGuideWidget)
            //{
            //    gameObject.RemoveComponent<UGuideWidget>();
            //}
            //else
            {
                UGuideWidget guideWidget = gameObject.GetComponent <UGuideWidget>();
                if (guideWidget == null)
                {
                    guideWidget = this.gameObject.AddComponent <UGuideWidget>();
                }
                guideWidget.GuideID       = (GUIDE.EGuideNodeID)item.nGuideID;
                guideWidget.GuideStepID   = item.nGuideStepID;
                guideWidget.GuideEffectID = item.nGuideEffectID;
                guideWidget.IsForceGuide  = true;
            }
            #endregion
        }