/// <summary> /// Raises the game scene shutdown event. /// </summary> /// <param name="sqlScene">Sql scene.</param> protected bool OnUnloadGameObserver(SqlScene sqlScene) { List<string> aryObserver = new List<string>(){ typeof(CharacterObserver).Name, typeof(MainObserver).Name, typeof(SyncObserver).Name, }; return UnregisterObserver(aryObserver.ToArray()); }
/// <summary> /// Raises the character scene event. /// </summary> /// <param name="sqlScene">Sql scene.</param> protected bool OnCharacterScene(SqlScene sqlScene) { LogicPlugin logicPlugin = GameEngine.GetSingleton().QueryPlugin<LogicPlugin> (); if (logicPlugin) { SqlSystem sqlSystem = GameSqlLite.GetSingleton().Query<SqlSystem>(0); if (!string.IsNullOrEmpty(sqlSystem.MainScript)) OnExecScript(sqlSystem.MainScript); CharacterObserver observer = logicPlugin.RegisterObserver<CharacterObserver>( typeof(CharacterObserver).Name ); if (observer) observer.Active(); } return true; }
/// <summary> /// Raises the city scene event. /// </summary> /// <param name="sqlScene">Sql scene.</param> protected bool OnLoadGameObserver(SqlScene sqlScene) { List<string> aryObserver = new List<string>(){ typeof(SyncObserver).Name, typeof(MainObserver).Name, typeof(PropertyObserver).Name }; return RegisterObserver(aryObserver.ToArray()); }
/// <summary> /// Raises the login scene event. /// </summary> /// <param name="sqlScene">Sql scene.</param> protected bool OnLoginScene(SqlScene sqlScene) { // destroy version update server Dispatcher.UnregisterObserver(typeof(VersionObserver).Name); // load login plugin LoginPlugin loginPlugin = GameEngine.GetSingleton ().LoadPlugin<LoginPlugin> (); if (loginPlugin) loginPlugin.Startup (); return true; }