/// <summary> /// Raises the scene load finished event. /// </summary> IEnumerator OnSceneLoadFinished(CmdEvent.SceneLoadEventArgs result) { // display loading progress if (LoadUI) { LoadUI.Progress = result.Progress; } yield return new WaitForEndOfFrame(); if (LoadUI) LoadUI.Hide(); switch(result.SceneID) { case SceneFlag.SCENE_LOGIN: // destroy version update server Dispatcher.UnregisterObserver(typeof(VersionObserver).Name); // load login plugin LoginPlugin loginPlugin = GameEngine.GetSingleton ().LoadPlugin<LoginPlugin> (); if (loginPlugin) loginPlugin.Startup (); break; case SceneFlag.SCENE_CHARACTER: LogicPlugin logicPlugin = GameEngine.GetSingleton().QueryPlugin<LogicPlugin> (); if (logicPlugin) { CharacterObserver observer = logicPlugin.RegisterObserver<CharacterObserver>( typeof(CharacterObserver).Name ); if (observer) observer.Active(); } break; default: /* * install game observer, load game scene */ Install(result); break; } }
/// <summary> /// Install this instance. /// </summary> protected bool Install(CmdEvent.SceneLoadEventArgs result) { // install open system InstallObserver(); return true; }
/// <summary> /// Raises the scene load finished event. /// </summary> IEnumerator OnSceneLoadFinished(CmdEvent.SceneLoadEventArgs result) { LoadingUI.Progress = result.Progress; yield return new WaitForEndOfFrame(); LoadingUI.Hide(); OneTimeInit(result.SceneID); }