private void ShowAbsent(ReadyPlayerSampleInfo data, NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, bool isSelf = false) { this._showAbsent = false; if (data != null && (cardType == NewHeroItem.CardType.HeroCardLeft || (cardType == NewHeroItem.CardType.HeroCardRight && !this._hideEnemy))) { this._showAbsent = !data.IsReadySelectHero; if (isSelf) { this._showAbsent = false; } } Transform transform = base.transform.Find("IsPresent"); if (transform) { transform.gameObject.SetActive(this._showAbsent); } else { ClientLogger.Error("cannot found IsPresent"); } }
private void ShowStars(NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, int starNumber = 0) { }
public void Init(HeroData herosData, NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, bool useShowFrame = true, bool changeStarDepth = true) { this.useShowFrame = useShowFrame; this.m_changeStarDepth = changeStarDepth; this.m_HeroTexture.material = CharacterDataMgr.instance.ReturnMaterialType(1); if (cardType == NewHeroItem.CardType.NullObject) { this.ShowAlphItem(); return; } if (this.m_Frame && this.m_Frame.gameObject) { this.m_Frame.gameObject.SetActive(true); } if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject) { this.m_CenterCanChange.gameObject.SetActive(false); } this.heroData = herosData; this.cardTypeRecord = cardType; this.InitHeroItem(); if (herosData != null) { this.ShowQuality(herosData.Quality); this.ShowStars(cardType, herosData.Stars); SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(herosData.HeroID); if (heroMainData == null) { ClientLogger.Error("HeroMain中查找" + herosData.HeroID + "结果为空,联系策划"); return; } if (this.cardTypeRecord == NewHeroItem.CardType.HeroCardLeft || this.cardTypeRecord == NewHeroItem.CardType.HeroCardRight) { SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId); if (this.cardTypeRecord == NewHeroItem.CardType.HeroCardRight && dataById != null && dataById.show_enemy_squad == 0) { if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject) { this.m_CenterCanChange.gameObject.SetActive(true); } } else { this.m_HeroTexture.material = CharacterDataMgr.instance.ReturnMaterialType(1); this.m_HeroTexture.mainTexture = ResourceManager.Load <Texture>(heroMainData.longAvatar_icon, true, true, null, 0, false); } } else { this.m_HeroTexture.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false); } this.m_LV.text = herosData.LV.ToString(); base.transform.name = herosData.HeroID; } else { base.transform.name = string.Empty; } if (this.m_Center && this.m_Center.gameObject) { this.m_Center.gameObject.SetActive(true); } switch (cardType) { case NewHeroItem.CardType.None: this.ShowItem(false); if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject) { this.m_CenterCanChange.gameObject.SetActive(true); } if (this.m_Center && this.m_Center.gameObject) { this.m_Center.gameObject.SetActive(false); } break; case NewHeroItem.CardType.Lock: this.ShowItem(false); this.ShowFrame(0, 0, "PVP_select_hero_03"); if (this.m_None && this.m_None.gameObject) { this.m_None.gameObject.SetActive(true); } break; case NewHeroItem.CardType.HeroAvator: if (this.m_BottomRight && this.m_BottomRight.gameObject) { this.m_BottomRight.gameObject.SetActive(false); } this.ShowFrame(218, 218, "PVP_select_hero_04"); this.m_LV.SetActive(false); break; case NewHeroItem.CardType.HeroCardLeft: this.ShowFrame(420, 140, "PVP_select_hero_01"); if (this.m_Bottom && this.m_Bottom.gameObject) { this.m_Bottom.gameObject.SetActive(false); } break; case NewHeroItem.CardType.HeroCardRight: this.ShowCardLeftOrRight(false); this.ShowFrame(420, 140, "PVP_select_hero_02"); if (this.m_Bottom && this.m_Bottom.gameObject) { this.m_Bottom.gameObject.SetActive(false); } break; } UIEventListener.Get(base.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSelectHero); }
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); }