diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Core/Callbacks/GlobalCallbacks.h |
Diffstat (limited to 'Runtime/Core/Callbacks/GlobalCallbacks.h')
-rw-r--r-- | Runtime/Core/Callbacks/GlobalCallbacks.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/Core/Callbacks/GlobalCallbacks.h b/Runtime/Core/Callbacks/GlobalCallbacks.h new file mode 100644 index 0000000..ddfccca --- /dev/null +++ b/Runtime/Core/Callbacks/GlobalCallbacks.h @@ -0,0 +1,30 @@ +#pragma once + +#include "CallbackArray.h" +#include "Runtime/Modules/ExportModules.h" + +struct EXPORT_COREMODULE GlobalCallbacks +{ + public: + + // Called after loading the level. + // Resets all Random number seeds in the engine after loading a level. + CallbackArray resetRandomAfterLevelLoad; + + CallbackArray didReloadMonoDomain; + CallbackArray didUnloadScene; + + CallbackArray registerGizmos; + + //only used by hacky audiocode, should be killed. + CallbackArray managersWillBeReloadedHack; + + CallbackArray willSaveScene; + CallbackArray initializedEngineGraphics; + + CallbackArray initialDomainReloadingComplete; + + static GlobalCallbacks& Get(); +}; + +#define REGISTER_GLOBAL_CALLBACK(eventName,body) struct eventName { static void Forward () { body; } }; GlobalCallbacks::Get().eventName.Register(eventName::Forward); |