void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 2
0
 public override void OnAwake()
 {
     if(Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogError("Warning multiple Game Music Managers!");
     }
     base.OnAwake();
     _audioSource = GameMainReferences.Instance.RTSCamera.GetComponent<AudioSource>();
     samples = new float[qSamples];
 }
Ejemplo n.º 3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        audioSource = GetComponent <AudioSource>();
    }
Ejemplo n.º 4
0
 void Awake()
 {
     instance = this;
 }