Beispiel #1
0
 private void InitSingleton()
 {
     if (instance == null)
     {
         instance = this;
         name = "[CM_CAMERA_MANAGER]";
         DontDestroyOnLoad(gameObject);
     }
     
     if (instance != this)
         Destroy(gameObject);
 }
Beispiel #2
0
 private void InitSingleton()
 {
     if (instance != null && instance != this)
     {
         Destroy(GetComponent <CM_CameraManager>());
     }
     else
     {
         instance = this;
         name    += "[CM_CameraManager]";
         DontDestroyOnLoad(this);
     }
 }