void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #2
0
    private void Awake()
    {
        if (sfxInstance != null && sfxInstance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        sfxInstance = this;
        DontDestroyOnLoad(this);
    }