BsScriptScene.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "BsScriptObject.h"
  6. namespace bs
  7. {
  8. /** @addtogroup ScriptInteropEngine
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for SceneManager. */
  12. class BS_SCR_BE_EXPORT ScriptScene : public ScriptObject<ScriptScene>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "Scene")
  16. /** Registers internal callbacks. Must be called on scripting system load. */
  17. static void startUp();
  18. /** Unregisters internal callbacks. Must be called on scripting system shutdown. */
  19. static void shutDown();
  20. /** Handles per-frame operations. Needs to be called every frame. */
  21. static void update();
  22. private:
  23. ScriptScene(MonoObject* instance);
  24. /** Triggered when the assembly refresh starts. */
  25. static void onRefreshStarted();
  26. /** Triggered when assembly domain is loaded during assembly refresh. */
  27. static void onRefreshDomainLoaded();
  28. /** Makes the provided prefab the currently active scene. */
  29. static void setActiveScene(const HPrefab& prefab);
  30. static HEvent OnRefreshDomainLoadedConn;
  31. static HEvent OnRefreshStartedConn;
  32. static UUID sActiveSceneUUID;
  33. static String sActiveSceneName;
  34. static bool sIsGenericPrefab;
  35. /************************************************************************/
  36. /* CLR HOOKS */
  37. /************************************************************************/
  38. static void internal_SetActiveScene(ScriptPrefab* scriptPrefab);
  39. static MonoObject* internal_GetRoot();
  40. static void internal_ClearScene();
  41. static MonoObject* internal_GetMainCameraSO();
  42. typedef void(BS_THUNKCALL *OnUpdateThunkDef)(MonoException**);
  43. static OnUpdateThunkDef onUpdateThunk;
  44. };
  45. /** @} */
  46. }