Ejemplo n.º 1
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }

        if (_instance != this)
        {
            DestroyImmediate(gameObject);
        }
    }
Ejemplo n.º 2
0
 private void OnApplicationQuit()
 {
     _instance = null;
     DestroyImmediate(gameObject);
 }