예제 #1
0
 public void Clear()
 {
     this._animation = null;
     this._animator  = null;
     this._particles.Clear();
     this._projectors.Clear();
     this._weaponTail = null;
 }
예제 #2
0
 public void InitComponent(Transform t, bool import)
 {
     this._animation = t.GetComponentInChildren <Animation>();
     this._animator  = t.GetComponentInChildren <Animator>();
     this._particles.Clear();
     t.GetComponentsInChildren <ParticleSystem>(false, this._particles);
     this._projectors.Clear();
     t.GetComponentsInChildren <Projector>(true, this._projectors);
     if (!import && XFxMgr.MaxParticleCount >= 0 && this._particles.Count > XFxMgr.MaxParticleCount)
     {
         for (int i = this._particles.Count - 1; i >= XFxMgr.MaxParticleCount; i--)
         {
             UnityEngine.Object.Destroy(this._particles[i].gameObject);
         }
         this._particles.RemoveRange(XFxMgr.MaxParticleCount, this._particles.Count - XFxMgr.MaxParticleCount);
     }
     for (int j = 0; j < this._particles.Count; j++)
     {
         this.PrePlayParticle(this._particles[j], XSingleton <XFxMgr> .singleton.CameraLayerMask);
     }
     this._weaponTail = t.GetComponentInChildren <IWeaponTail>();
 }