Esempio n. 1
0
 public Root(SoundPool.RootID id)
 {
     this.id = id;
 }
Esempio n. 2
0
 public void EnterLimbo()
 {
     switch (this.rootID)
     {
         case SoundPool.RootID.LIMBO:
         case SoundPool.RootID.DISPOSED:
         {
             return;
         }
         case SoundPool.RootID.RESERVED:
         {
             break;
         }
         default:
         {
             this.audio.Stop();
             this.audio.enabled = false;
             this.audio.clip = null;
             this.parent = null;
             break;
         }
     }
     if (!this.way.prev.has)
     {
         this.root.first = this.way.next;
     }
     else
     {
         this.way.prev.node.way.next = this.way.next;
     }
     if (this.way.next.has)
     {
         this.way.next.node.way.prev = this.way.prev;
     }
     SoundPool.Root root = this.root;
     root.count = root.count - 1;
     this.way = new SoundPool.Way();
     this.root = null;
     this.rootID = SoundPool.RootID.LIMBO;
 }
Esempio n. 3
0
 public void Reserve()
 {
     switch (this.rootID)
     {
         case SoundPool.RootID.LIMBO:
         {
             break;
         }
         case SoundPool.RootID.RESERVED:
         case SoundPool.RootID.DISPOSED:
         {
             return;
         }
         default:
         {
             this.audio.Stop();
             this.audio.enabled = false;
             this.audio.clip = null;
             this.parent = null;
             if (this.way.next.has)
             {
                 this.way.next.node.way.prev = this.way.prev;
             }
             if (!this.way.prev.has)
             {
                 this.root.first = this.way.next;
             }
             else
             {
                 this.way.prev.node.way.next = this.way.next;
             }
             SoundPool.Root root = this.root;
             root.count = root.count - 1;
             this.way = new SoundPool.Way();
             break;
         }
     }
     this.root = SoundPool.reserved;
     this.rootID = SoundPool.RootID.RESERVED;
     this.way.next = SoundPool.reserved.first;
     if (this.way.next.has)
     {
         this.way.next.node.way.prev.has = true;
         this.way.next.node.way.prev.node = this;
     }
     SoundPool.reserved.first.has = true;
     SoundPool.reserved.first.node = this;
     SoundPool.Root root1 = SoundPool.reserved;
     root1.count = root1.count + 1;
 }
Esempio n. 4
0
 public void Dispose()
 {
     switch (this.rootID)
     {
         case SoundPool.RootID.LIMBO:
         {
             break;
         }
         case SoundPool.RootID.RESERVED:
         {
             this.EnterLimbo();
             break;
         }
         case SoundPool.RootID.DISPOSED:
         {
             return;
         }
         default:
         {
             goto case SoundPool.RootID.RESERVED;
         }
     }
     UnityEngine.Object.Destroy(this.transform.gameObject);
     this.transform = null;
     this.audio = null;
     this.rootID = SoundPool.RootID.DISPOSED;
     GC.SuppressFinalize(this);
     GC.KeepAlive(this);
 }