Ejemplo n.º 1
0
 void OnEnable()
 {
     //attach method to scene load event
     SceneManager.sceneLoaded += OnSceneLoaded;
     audioSource      = GetComponent <AudioSource>();
     audioSource.loop = true;
     DontDestroyOnLoad(gameObject);
     if (audioSingleton == null)
     {
         audioSingleton = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     current = this;
     audioSource1.loop = true;
 }