void Awake() { // Self-destruct if more than one ManagerWrangler exists if (initialized == true) { Destroy(this); Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); gameObject.hideFlags = HideFlags.NotEditable; initialized = true; Instance = this; // Each object's Awake and OnEnable methods are automatically called when // the ScriptableObject is instantiated managers = Manager.GetAllManagers(); StartCoroutine(CoroutineUpdatePump()); StartCoroutine(CoroutineFixedUpdatePump()); }
void Awake() { // Self-destruct if more than one ManagerWrangler exists if (initialized == true) { Destroy (this); Destroy (gameObject); return; } DontDestroyOnLoad (gameObject); gameObject.hideFlags = HideFlags.NotEditable; initialized = true; Instance = this; // Each object's Awake and OnEnable methods are automatically called when // the ScriptableObject is instantiated managers = Manager.GetAllManagers (); StartCoroutine (CoroutineUpdatePump ()); StartCoroutine (CoroutineFixedUpdatePump ()); }