public Root(SoundPool.RootID id) { this.id = id; }
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; }
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; }
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); }