Exemple #1
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");
            }
        }