Exemplo n.º 1
0
    // Start is called before the first frame update
    void Awake()
    {
        if (s_Instance == null)
        {
            s_Instance = this;
        }
        else
        {
            Destroy(this.gameObject);

            return;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Exemplo n.º 2
0
 void OnApplicationQuit()
 {
     s_Instance = null;
 }