The ecs stuff does not get loaded until they are required in lua

This commit is contained in:
2019-03-07 00:39:02 +01:00
parent 96ad0de01a
commit 53a0b98341
5 changed files with 134 additions and 117 deletions

View File

@@ -14,8 +14,8 @@ namespace ecs::lua {
};
template <typename T, typename... Constructor, typename... Args>
void register_component(sol::state& lua, Args... args) {
lua.new_usertype<T>(get_typename<T>(),
void register_component(sol::state& lua, sol::table& table, Args... args) {
table.new_usertype<T>(get_typename<T>(),
"new", sol::factories([](Constructor... constructor) {
return new T(constructor...);
}), args...