//**************************************************************************************************** // //**************************************************************************************************** public void Awake() { if (m_instance == null) { m_instance = this; } }
//**************************************************************************************************** // //**************************************************************************************************** public void OnDestroy() { options.Save(); if (m_instance == this) { m_instance = null; } m_UI.Destroy(); if (m_navModes != null) { m_navModes.Destroy(); m_navModes = null; } }
/// <summary> /// Sets up and runs the application. The run method shall block until the application is shut down /// </summary> public int Run() { using (ComponentContainer ComponentContainer = new ComponentContainer(this.componentRepository)) { ISplashScreen SplashScreen = ComponentContainer.TryResolveInstance <ISplashScreen>() ?? new SplashDummy(); SplashScreen.Show(); IApplicationMain ApplicationMain; try { this.ResolveModules(ComponentContainer); ApplicationMain = ComponentContainer.ResolveInstance <IApplicationMain>(status => SplashScreen.SetStatus(status)); } finally { SplashScreen.Hide(); } //Get Main Module return(ApplicationMain.Run(ComponentContainer)); } }