void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
         return;
     }
     _instance = this;
     DontDestroyOnLoad(gameObject);
     InitializeAudioSource();
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        fillSounds();
    }