コード例 #1
0
ファイル: ModelRotate.cs プロジェクト: whztt07/mobahero_src
 public void ShowModel()
 {
     if (this.m_modelObj != null)
     {
         this.m_modelObj.SetActive(true);
         if (this.prevhero != string.Empty)
         {
             AudioMgr.unloadLanguageSoundBank(this.prevhero, 0);
         }
         Hero          component    = this.m_modelObj.GetComponent <Hero>();
         string        text         = string.Empty;
         SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(this.hero_id);
         if (heroMainData != null)
         {
             text = heroMainData.music_id;
         }
         AudioMgr.SetLisenerPos_NoDir(AudioMgr.Instance.transform, Vector3.zero, 0);
         AudioMgr.loadLanguageSoundBank(text, 0);
         HeroVoicePlayer.playHeroVoice(text, true, AudioMgr.Instance.exSoundObj);
         this.prevhero = component.musicid;
         if (this.m_animatorControllerHeroObj != null)
         {
             this.m_animatorControllerHeroObj.Play("HeroBreath1");
         }
     }
 }
コード例 #2
0
ファイル: Hero.cs プロジェクト: whztt07/mobahero_src
 protected override void OnCreate()
 {
     this.data          = base.AddUnitComponent <HeroDataManager>(!Singleton <PvpManager> .Instance.IsInPvp);
     this.EquipPackage  = base.AddUnitComponent <HeroEquipPackage>();
     this.atkController = base.AddUnitComponent <HeroAttackController>();
     base.OnCreate();
     base.ChangeLayer("Unit");
     this.musicid = this.data.GetData <string>(DataType.MusicId);
     this.m_hv    = base.gameObject.GetComponent <HeroVoicePlayer>();
     if (this.m_hv == null)
     {
         this.m_hv = base.gameObject.AddComponent <HeroVoicePlayer>();
     }
     if (this.m_model != null)
     {
         eventPlayerSound eventPlayerSound = this.m_model.gameObject.GetComponent <eventPlayerSound>();
         if (eventPlayerSound == null)
         {
             eventPlayerSound = this.m_model.gameObject.AddComponent <eventPlayerSound>();
         }
         eventPlayerSound.units  = this;
         this.m_eventPlayerSound = eventPlayerSound;
         HeroVoicePlayer component = this.m_model.gameObject.GetComponent <HeroVoicePlayer>();
         if (component != null)
         {
             component.enabled = false;
         }
     }
     if (RecieverObjCtrl.usefakeshadow)
     {
         if (this.roc == null)
         {
             this.roc = base.GetComponentInChildren <RecieverObjCtrl>();
         }
         if (this.roc == null)
         {
             GameObject   gameObject   = new GameObject("recieverObj_auto");
             MeshRenderer meshRenderer = gameObject.AddComponent <MeshRenderer>();
             meshRenderer.enabled = false;
             MeshFilter meshFilter = gameObject.AddComponent <MeshFilter>();
             meshFilter.mesh             = null;
             meshFilter.sharedMesh       = null;
             gameObject.transform.parent = base.transform;
             this.roc            = gameObject.AddComponent <RecieverObjCtrl>();
             this.roc.skintarget = base.GetComponentInChildren <SkinnedMeshRenderer>();
             this.roc.updatamesh3();
             this.roc.doStart();
         }
         else
         {
             this.roc.skintarget = base.GetComponentInChildren <SkinnedMeshRenderer>();
             this.roc.updatamesh3();
             this.roc.doStart();
         }
     }
 }