/// <summary>
 /// Destroy the currently loaded scene. Does nothing if no scene is loaded.
 /// </summary>
 public void destroyScene()
 {
     if (currentScene != null)
     {
         if (OnSceneUnloading != null)
         {
             OnSceneUnloading.Invoke(this, currentScene);
         }
         currentSimObjects.Dispose();
         currentSimObjects = null;
         currentScene.Dispose();
         currentScene = null;
         if (OnSceneUnloaded != null)
         {
             OnSceneUnloaded.Invoke(this, null);
         }
     }
 }
Example #2
0
        internal static void Internal_OnSceneEvent(SceneEventType eventType, Scene scene, ref Guid sceneId)
        {
            switch (eventType)
            {
            case SceneEventType.OnSceneSaving: OnSceneSaving?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneSaved: OnSceneSaved?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneSaveError: OnSceneSaveError?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneLoading: OnSceneLoading?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneLoaded: OnSceneLoaded?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneLoadError: OnSceneLoadError?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneUnloading: OnSceneUnloading?.Invoke(scene, sceneId); break;

            case SceneEventType.OnSceneUnloaded: OnSceneUnloaded?.Invoke(scene, sceneId); break;
            }
        }
Example #3
0
 public void destroyScene()
 {
     if (scene != null)
     {
         foreach (DebugInterface debugInterface in controller.PluginManager.DebugInterfaces)
         {
             debugInterface.destroyDebugInterface(controller.PluginManager.RendererPlugin, scene.getDefaultSubScene());
         }
         if (OnSceneUnloading != null)
         {
             OnSceneUnloading.Invoke(this, scene);
         }
         scene.Scope.Dispose();
         scene.Dispose();
         scene = null;
         if (OnSceneUnloaded != null)
         {
             OnSceneUnloaded.Invoke(this, null);
         }
     }
 }