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