Exemplo n.º 1
0
    private void RefreshUI_heroIcon()
    {
        ReadyPlayerSampleInfo memInfo      = this.MemInfo;
        SysHeroMainVo         heroMainData = BaseDataMgr.instance.GetHeroMainData(memInfo.GetHeroId());

        if (heroMainData == null)
        {
            ClientLogger.Error("找不到heroMain表信息,heroID=" + memInfo.GetHeroId());
            return;
        }
        string text = string.Empty;

        if (memInfo.heroSkinId != "0" && memInfo.heroSkinId != string.Empty)
        {
            Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysHeroSkinVo>();
            if (dicByType != null && dicByType.ContainsKey(memInfo.heroSkinId))
            {
                SysHeroSkinVo sysHeroSkinVo = dicByType[memInfo.heroSkinId] as SysHeroSkinVo;
                if (sysHeroSkinVo != null)
                {
                    text = sysHeroSkinVo.avatar_icon;
                }
                else
                {
                    ClientLogger.Error("找不到SysHeroSkinVo表信息,skinID=" + memInfo.heroSkinId);
                }
            }
            else
            {
                ClientLogger.Error("找不到SysHeroSkinVo表信息2,skinID=" + memInfo.heroSkinId);
            }
        }
        else
        {
            text = heroMainData.avatar_icon;
        }
        if (!string.IsNullOrEmpty(text))
        {
            this.sp_heroIcon.mainTexture = ResourceManager.Load <Texture>(text, true, true, null, 0, false);
        }
    }
Exemplo n.º 2
0
 private static EntityVo GetVo(ReadyPlayerSampleInfo info)
 {
     if (info == null)
     {
         throw new ArgumentException("info is null");
     }
     if (info.heroInfo == null)
     {
         throw new ArgumentException("heroinfo is null:" + StringUtils.DumpObject(info));
     }
     return(new EntityVo(EntityType.Hero, info.GetHeroId(), CharacterDataMgr.instance.GetLevel(info.heroInfo.exp), info.heroInfo.star, info.heroInfo.quality, 0f, 0f, 0, 0));
 }
Exemplo n.º 3
0
    public void InitPVP(ReadyPlayerSampleInfo data, NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, bool isSelf = false)
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);

        if (dataById == null)
        {
            return;
        }
        this._hideEnemy = (dataById.show_enemy_squad == 0);
        if (Singleton <PvpManager> .Instance.IsObserver)
        {
            this._hideEnemy = false;
        }
        this.ShowAbsent(data, cardType, isSelf);
        HeroData herosData = null;

        if (this.m_UnConnect == null && this.m_CenterCanChange == null)
        {
            return;
        }
        if (data == null || data.heroInfo == null)
        {
            this.m_UnConnect.gameObject.SetActive(true);
            this.m_CenterCanChange.gameObject.SetActive(false);
        }
        if (data != null && data.heroInfo != null && !string.IsNullOrEmpty(data.GetHeroId()))
        {
            herosData = new HeroData
            {
                HeroID  = data.GetHeroId(),
                Stars   = data.heroInfo.star,
                Quality = data.heroInfo.quality,
                LV      = CharacterDataMgr.instance.GetLevel(data.heroInfo.exp)
            };
        }
        this.m_UnConnect.gameObject.SetActive(false);
        this.m_CustomName.text = string.Empty;
        if (cardType == NewHeroItem.CardType.Lock)
        {
            this.Init(null, cardType, true, true);
        }
        else if (cardType == NewHeroItem.CardType.HeroCardLeft)
        {
            this.m_CustomName.text = data.userName;
            if (isSelf)
            {
                this.m_CustomName.color = new Color(0.996078432f, 0.772549033f, 0.003921569f);
            }
            if (data.CharmRankvalue <= 50)
            {
                this.m_CustomName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(data.CharmRankvalue);
            }
            this.Init(herosData, NewHeroItem.CardType.HeroCardLeft, true, true);
            this.m_CenterCanChangeLabel.text = ((!isSelf) ? "?" : LanguageManager.Instance.GetStringById("PVPChooseHeroUI_ChooseHeroHelp"));
            this.m_CenterCanChange.gameObject.SetActive(true);
            this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Left;
            Transform arg_224_0        = this.m_CustomName.transform;
            Vector3   localEulerAngles = Vector3.one;
            this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
            arg_224_0.localEulerAngles = localEulerAngles;
            this.m_BottomLeft.gameObject.SetActive(true);
        }
        else if (cardType == NewHeroItem.CardType.HeroCardRight)
        {
            if (this._hideEnemy)
            {
                this.m_CustomName.text = LanguageManager.Instance.GetStringById("SummonerUI_Title_Summoner") + (base.transform.GetSiblingIndex() + 1);
                this.Init(herosData, NewHeroItem.CardType.HeroCardRight, true, true);
                if (this.m_CenterCanChangeLabel.text != "?")
                {
                    this.m_CenterCanChangeLabel.text = "?";
                }
                this.m_HeroTexture.enabled = false;
                this.m_CenterCanChange.gameObject.SetActive(true);
                this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Right;
                Transform arg_316_0        = this.m_CustomName.transform;
                Vector3   localEulerAngles = new Vector3(0f, 180f, 0f);
                this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
                arg_316_0.localEulerAngles = localEulerAngles;
                this.m_BottomLeft.gameObject.SetActive(true);
            }
            else
            {
                this.m_CustomName.text = data.userName;
                if (data.CharmRankvalue <= 50)
                {
                    this.m_CustomName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(data.CharmRankvalue);
                }
                this.Init(herosData, NewHeroItem.CardType.HeroCardRight, true, true);
                this.m_CenterCanChangeLabel.text = ((!isSelf) ? "?" : LanguageManager.Instance.GetStringById("PVPChooseHeroUI_ChooseHeroHelp"));
                this.m_CenterCanChange.gameObject.SetActive(true);
                this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Right;
                Transform arg_3F2_0        = this.m_CustomName.transform;
                Vector3   localEulerAngles = new Vector3(0f, 180f, 0f);
                this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
                arg_3F2_0.localEulerAngles = localEulerAngles;
                this.m_BottomLeft.gameObject.SetActive(true);
            }
        }
        if (cardType == NewHeroItem.CardType.HeroCardRight || cardType == NewHeroItem.CardType.HeroCardLeft)
        {
            if (this.heroData == null)
            {
                this.m_TopLeft.gameObject.SetActive(false);
                this.m_TopRight.gameObject.SetActive(false);
            }
            if (this.heroData == null)
            {
                this.GrayHeroItem(this.heroData);
            }
        }
        this._bindedNewUid = ((data == null) ? 0 : data.newUid);
    }