public static void destroy() { if(instance!=null) { if(soundPlayer!=null) { soundPlayer.clearBGM(); soundPlayer.clearSE(); soundPlayer = null; } if(psoundObj!=null) { GameObject.Destroy(psoundObj); psoundObj = null; } instance = null; } }
static public void destroy() { if (instance != null) { if (soundPlayer != null) { soundPlayer.clearBGM(); soundPlayer.clearSE(); soundPlayer = null; } if (psoundObj != null) { GameObject.Destroy(psoundObj); psoundObj = null; } instance = null; } }
public static void setup(bool dontDestroyOnLoad = false) { if (!psoundObj) { psoundObj = new GameObject("PSound"); } if (dontDestroyOnLoad) { UnityEngine.Object.DontDestroyOnLoad(psoundObj); } if (soundPlayer == null) { soundPlayer = new PSoundPlayer(); } if (Camera.main != null && Camera.main.gameObject.GetComponent <AudioListener>() == null) { Camera.main.gameObject.AddComponent <AudioListener> (); } }
public static void setup(bool dontDestroyOnLoad = false) { if(!psoundObj) { psoundObj = new GameObject("PSound"); } if(dontDestroyOnLoad) { UnityEngine.Object.DontDestroyOnLoad(psoundObj); } if(soundPlayer==null) { soundPlayer = new PSoundPlayer(); } if(Camera.main!=null && Camera.main.gameObject.GetComponent<AudioListener>()==null) { Camera.main.gameObject.AddComponent<AudioListener> (); } }