Example #1
0
        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");
                }
            }
        }
Example #2
0
        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");
            }
        }