Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 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;
     }
 }
Beispiel #3
0
 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> ();
     }
 }
Beispiel #4
0
 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> ();
     }
 }