public void OpenAwakeAwardForm() { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFinishFormPath, false, true); if (script != null) { Text component = script.transform.Find("Panel/panelRewards/award1/lblDesc").GetComponent <Text>(); Text text2 = script.transform.Find("Panel/panelRewards/award2/lblDesc").GetComponent <Text>(); CUI3DImageScript script2 = script.transform.Find("3DImage").GetComponent <CUI3DImageScript>(); ResTalentLib dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID); if (dataByKey != null) { component.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc); } ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID); if (heroSkin != null) { string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) }; text2.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args); } ObjNameData data = CUICommonSystem.GetHeroPrefabPath(this.m_heroInfo.cfgInfo.dwCfgID, (int)heroSkin.dwSkinID, true); GameObject model = (script2 == null) ? null : script2.AddGameObject(data.ObjectName, false, false); if (model != null) { CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(model); instance.InitAnimatList(); instance.InitAnimatSoundList(this.m_heroInfo.cfgInfo.dwCfgID, heroSkin.dwSkinID); instance.OnModePlayAnima("Come"); } } }
private void OnShowGiveFriendSkin(uint heroId, uint skinId, uint price) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); if (heroSkin == null) { return; } CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/System/", "Mall/Form_GiveHeroSkin_3D.prefab"), false, true); Text component = cUIFormScript.transform.Find("Panel/skinNameText").GetComponent <Text>(); component.set_text(heroSkin.szSkinName); GameObject gameObject = cUIFormScript.transform.Find("Panel/Panel_Prop/List_Prop").gameObject; CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr); CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr); Text component2 = cUIFormScript.transform.Find("Panel/pricePanel/priceText").GetComponent <Text>(); component2.set_text(price.ToString()); CUIEventScript component3 = cUIFormScript.transform.Find("Panel/BtnGroup/buyButton").gameObject.GetComponent <CUIEventScript>(); stUIEventParams eventParams = default(stUIEventParams); eventParams.heroSkinParam.heroId = heroId; eventParams.heroSkinParam.skinId = skinId; eventParams.heroSkinParam.isCanCharge = true; eventParams.commonUInt64Param1 = this._curFriendUid; eventParams.commonBool = this._curFriendIsSns; eventParams.commonUInt32Param1 = this._curWorldId; component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, eventParams); CUI3DImageScript component4 = cUIFormScript.transform.Find("Panel/3DImage").gameObject.GetComponent <CUI3DImageScript>(); ObjNameData heroPrefabPath = CUICommonSystem.GetHeroPrefabPath(heroId, (int)skinId, true); GameObject gameObject2 = component4.AddGameObject(heroPrefabPath.ObjectName, false, false); if (gameObject2 != null) { if (heroPrefabPath.ActorInfo != null) { gameObject2.transform.localScale = new Vector3(heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale); } DynamicShadow.EnableDynamicShow(component4.gameObject, true); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(gameObject2); instance.InitAnimatList(); instance.InitAnimatSoundList(heroId, skinId); instance.OnModePlayAnima("Come"); } }
private static void Show3DModel(CUIFormScript belongForm) { CUI3DImageScript cUI3DImageScript = null; Transform transform = belongForm.transform.Find("Root/Panel_Award/3DImage"); if (transform != null) { cUI3DImageScript = transform.GetComponent <CUI3DImageScript>(); } if (cUI3DImageScript == null) { return; } CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; PlayerKDA hostKDA = playerKDAStat.GetHostKDA(); if (hostKDA == null) { return; } ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); uint num = 0u; while (enumerator.MoveNext()) { HeroKDA current = enumerator.get_Current(); if (current != null) { num = (uint)current.HeroId; break; } } int heroWearSkinId = (int)Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetHeroWearSkinId(num); GameObject gameObject = cUI3DImageScript.AddGameObject(CUICommonSystem.GetHeroPrefabPath(num, heroWearSkinId, true).ObjectName, false, false); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(gameObject); if (gameObject == null) { return; } instance.InitAnimatList(); instance.InitAnimatSoundList(num, (uint)heroWearSkinId); }