summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaHelper.h
blob: c3cd70e9513eaa82bc27005c0f335332b5198e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once
#include "Runtime/Math/Rect.h"
#include "Runtime/Math/Vector2.h"
#include "./LuaBind/LuaBind.h"

// lua 5.1 doc: https://www.lua.org/manual/5.1/

// 针对GameLab做一些扩展
class LuaHelper 
{
public:
    static int Call(const char* func, const char* params, ...);
	static bool IsType(LuaBind::State& state, const char* typeName, int idx);
	static void OnRegisterNativeClass(LuaBind::State& state, int cls, std::string clsName, std::string pkgName);
    // 创建lua类的实例并留在栈顶,如果失败返回false且不压栈
    static bool InstantiateClass(LuaBind::State& state, const char* classFullName);
        
};