コード例 #1
0
ファイル: Hero.cs プロジェクト: whztt07/mobahero_src
 protected override void OnInit(bool isRebirth = false)
 {
     if (!base.MirrorState)
     {
         this.heroData = Singleton <PvpManager> .Instance.GetHeroInfoData(this.unique_id);
     }
     base.OnInit(isRebirth);
     this.m_fLiveTime = -1f;
     this.m_fLeftTime = 0f;
     this.musicid     = this.data.GetData <string>(DataType.MusicId);
     if (this.m_hv != null)
     {
         this.m_hv.init(this.musicid);
     }
     if (RecieverObjCtrl.usefakeshadow)
     {
         if (this.roc == null)
         {
             this.roc = base.GetComponentInChildren <RecieverObjCtrl>();
         }
         if (this.roc != null)
         {
             string[] array = base.name.Split(new char[]
             {
                 '+'
             });
             this.roc.setnpcid(array[0]);
         }
     }
     if (this.InitCount == 0)
     {
         AudioMgr.loadSoundBank_Skill(this.musicid, false, HeroSkins.GetRealHeroSkin(base.TeamType, base.model_id));
     }
     if (this.m_eventPlayerSound != null)
     {
         this.m_eventPlayerSound.isplayer = this.isPlayer;
     }
     if (this.isPlayer)
     {
         base.controllerType = 1;
         AudioMgr.AddLisener(base.gameObject);
         AudioMgr.loadLanguageSoundBank(this.musicid, HeroSkins.GetRealHeroSkin(base.TeamType, base.model_id));
     }
     else
     {
         base.controllerType = 0;
     }
     if (!base.MirrorState)
     {
     }
     this.InitCount++;
     this.TryInitHeroVisibleOnReplay(isRebirth);
 }
コード例 #2
0
 public void SetPlayer(GameObject obj)
 {
     if (obj == null)
     {
         return;
     }
     this.Player = null;
     this.Player = obj.GetComponent <EditorUnit>();
     if (this.Player == null)
     {
         this.Player = obj.AddComponent <EditorUnit>();
     }
     this.gamePlay.MobaCamera.SetTargetTransform(obj.transform);
     AudioMgr.AddLisener(base.gameObject);
 }