summaryrefslogtreecommitdiff
path: root/Runtime/Scripting/RuntimeScriptGlobals.h
blob: e6e63479a5b9b4f1019e94dbf8a67448bc848129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include "Runtime/Lua/LuaHelper.h"

#define DECL_LUA_FUNC(name) LuaBind::LuaFunction name

#ifdef GAMELAB_EDITOR
#define SCRIPT_GLOBAL EditorScriptingManager::Instance()->GetGlobals()
#elif defined(GAMELAB_RUNNER)
#define SCRIPT_GLOBAL 
#endif

// 全局方法和变量
struct RuntimeScriptGlobals
{
	DECL_LUA_FUNC(setCurrentEvent);

    DECL_LUA_FUNC(guiBeginFrame);
    DECL_LUA_FUNC(guiEndFrame);
    DECL_LUA_FUNC(guiBeginOnGUI);
    DECL_LUA_FUNC(guiEndOnGUI);
};

namespace Scripting 
{
    void FillRuntimeScriptGlobals(RuntimeScriptGlobals& globals);
}