public void OnGUI() { if (this.clips != null) { foreach (AudioClip clip in this.clips) { if (GUILayout.Button(clip.name, new GUILayoutOption[0])) { clip.Play(); } } } GUI.Box(new Rect((float)(Screen.width - 0x100), 0f, 256f, 24f), "Total Sound Nodes " + SoundPool.totalCount); GUI.Box(new Rect((float)(Screen.width - 0x100), 30f, 256f, 24f), "Playing Sound Nodes " + SoundPool.playingCount); GUI.Box(new Rect((float)(Screen.width - 0x100), 60f, 256f, 24f), "Reserve Sound Nodes " + SoundPool.reserveCount); if (GUI.Button(new Rect((float)(Screen.width - 0x80), 90f, 128f, 24f), "Drain Reserves")) { SoundPool.DrainReserves(); } if (GUI.Button(new Rect((float)(Screen.width - 0x80), 120f, 128f, 24f), "Drain")) { SoundPool.Drain(); } if (GUI.Button(new Rect((float)(Screen.width - 0x80), 150f, 128f, 24f), "Stop All")) { SoundPool.Stop(); } }
public void OnGUI() { if (this.clips != null) { AudioClip[] audioClipArray = this.clips; for (int i = 0; i < (int)audioClipArray.Length; i++) { AudioClip audioClip = audioClipArray[i]; if (GUILayout.Button(audioClip.name, new GUILayoutOption[0])) { audioClip.Play(); } } } GUI.Box(new Rect((float)(Screen.width - 256), 0f, 256f, 24f), string.Concat("Total Sound Nodes ", SoundPool.totalCount)); GUI.Box(new Rect((float)(Screen.width - 256), 30f, 256f, 24f), string.Concat("Playing Sound Nodes ", SoundPool.playingCount)); GUI.Box(new Rect((float)(Screen.width - 256), 60f, 256f, 24f), string.Concat("Reserve Sound Nodes ", SoundPool.reserveCount)); if (GUI.Button(new Rect((float)(Screen.width - 128), 90f, 128f, 24f), "Drain Reserves")) { SoundPool.DrainReserves(); } if (GUI.Button(new Rect((float)(Screen.width - 128), 120f, 128f, 24f), "Drain")) { SoundPool.Drain(); } if (GUI.Button(new Rect((float)(Screen.width - 128), 150f, 128f, 24f), "Stop All")) { SoundPool.Stop(); } }
private void OnDestroy() { if (SoundPoolFilter.instance == this) { this.awake = false; SoundPoolFilter.instance = null; SoundPool.enabled = false; if (this.quitting) { SoundPool.Drain(); } } }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; switch (num) { case 0: this.$current = null; this.$PC = 1; goto Label_0098; case 1: this.$current = null; this.$PC = 2; goto Label_0098; case 2: try { SoundPool.Drain(); } catch (Exception exception) { this.< e > __0 = exception; UnityEngine.Debug.LogException(this.< e > __0); } try { DestroysOnDisconnect.OnDisconnectedFromServer(); } catch (Exception exception2) { this.< e > __1 = exception2; UnityEngine.Debug.LogException(this.< e > __1); } this.$PC = -1; break; } return(false); Label_0098: return(true); }