Exemplo n.º 1
0
 void Awake()
 {
     if (instance != null) {
         Debug.Log ("Wrong");
         //Destroy (gameObject);
         return;
     }
     instance = this;
 }
Exemplo n.º 2
0
 public static DontGetDestroyedOverlay GetInstance()
 {
     if (instance == null) {
         GameObject go = new GameObject("Whatever");
         go.AddComponent<DontGetDestroyedOverlay>();
         instance = go.GetComponent<DontGetDestroyedOverlay>();
     }
     return instance;
 }