Exemple #1
0
 // destroy instance on destroy
 private void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Exemple #2
0
        // initialize instance
        private void Awake()
        {
            if (_instance != null)
            {
                Destroy(gameObject);
            }
            else
            {
                _instance = this;
            }

            _sentences = new Queue <string>();
        }