// ================================================================================ // private methods // -------------------------------------------------------------------------------- protected bool Init() { if (Instance != null) { return(false); } Instance = this; TextManagerInit textManagerInit = GetComponentInChildren <TextManagerInit>(); if (textManagerInit != null) { textManagerInit.Init(); } baseAudioManager = GetComponent <BaseAudioManager>(); baseNavigationInput = GetComponent <BaseNavigationInput>(); messenger = GetComponent <Messenger>(); applicationInfo = new ApplicationInfo(); gamepadInput = transform.GetInterface <IGamepadInput>(); inputController = transform.GetInterface <IInputController>(); // object shall persist through all levels DontDestroyOnLoad(gameObject); return(true); }
// ================================================================================ // private methods // -------------------------------------------------------------------------------- protected bool Init() { if (Instance != null) { return false; } Instance = this; TextManagerInit textManagerInit = GetComponentInChildren<TextManagerInit>(); if (textManagerInit != null) { textManagerInit.Init(); } baseAudioManager = GetComponent<BaseAudioManager>(); baseNavigationInput = GetComponent<BaseNavigationInput>(); messenger = GetComponent<Messenger>(); applicationInfo = new ApplicationInfo(); gamepadInput = transform.GetInterface<IGamepadInput>(); inputController = transform.GetInterface<IInputController>(); // object shall persist through all levels DontDestroyOnLoad(gameObject); return true; }