public TWEngine() { ReloadScheduled = false; GameplayDll = "../../Gameplay/bin/x86/Debug/Gameplay.dll"; GameplayDll = "../BinariesGame/Gameplay.dll"; codeLoader = new RestartCodeLoader(this); // Use the PersistentCodeLoader for the old style hotloading! TraceLogger = new EngineTraceLogger(); EngineErrorLogger = new EngineErrorLogger(); // WARNING: BUG: Note: this is somewhat fishy!!! DI.Set <IErrorLogger>(EngineErrorLogger); }
/// <summary> /// Resets all the persistent things about the engine, which are not from the gameplay dll /// </summary> public void ClearAllEngineState() { TW.Graphics.AcquireRenderer().ClearAll(); TW.Physics.ClearAll(); EngineErrorLogger.ClearLast(); try { TW.Engine.OnClearEngineState(); } // Executes user code, so execute after logger clear so that error can occur in log catch (Exception ex) { EngineErrorLogger.Log(ex, "ClearStateCallback"); } TW.Engine.ClearCallbacks(); }