Comments (1)
1、静态绑定demo,仅供参考:
class BASIC_API FTimeTicker
{
public:
FTimeTicker();
~FTimeTicker();
// constructor function for lua
// LuaOwnedPtr will hold ptr by lua and auto collect it;
static NS_SLUA::LuaOwnedPtr<FTimeTicker> create();
void SetTickFunction(const NS_SLUA::LuaVar& LuaFunction);
void AddTimer(int index, float InFirstDelay);
void Tick(float DeltaTime);
}
// 静态绑定代码
namespace NS_SLUA
{
DefLuaClass(FTimeTicker)
DefLuaMethod(SetTickFunction, &FTimeTicker::SetTickFunction)
DefLuaMethod(AddTimer, &FTimeTicker::AddTimer)
DefLuaMethod(Tick, &FTimeTicker::Tick)
EndDef(FTimeTicker, &FTimeTicker::create)
}
2、静态绑定代码生成工具是这个:
https://github.com/Tencent/sluaunreal/tree/master/Tools/lua-wrapper.exe
另:对于反射方面的性能的顾虑,我觉得大可不必,一般都是够用的了,项目实践中我们更多的是利用反射功能。性能方面的顾虑可参考官网readme最后的benchmark表格。欢迎使用slua!
from sluaunreal.
Related Issues (20)
- 不能调用蓝图创建的蓝图函数库的函数 HOT 3
- SetAnimClass的需要传入参数是一个UClass,但是却必须要我传入UObject HOT 1
- 严重恶性BUG,无法使用定时器K2_SetTimerDelegate HOT 1
- AllowWindowsPlatformTypes的类的位置不对导致编译不通过 HOT 1
- UE5.2打包项目报错,LuaDelegate.h和SluaUtil.cpp的编译条件不一致
- 能支持lua5.1吗?否则没法用luajit。 HOT 1
- 5.3打包報錯 HOT 2
- lua wrapper 中 config.json格式问题
- 在 Content Browser 中显示 lua 脚本
- 请问支持ue5.2及5.3吗? HOT 6
- sluaunreal-2.1.2 中 MyGameInstance.h 导致编译报错 HOT 2
- ue5.2 编译报错 HOT 1
- tag2.1.2 http c++绑定不能用了 HOT 2
- DefLuaMethod 导出类方法编译失败 HOT 4
- vscode luapanda lua 代码辅助功能打开没有填写Cpp文件夹路径的选项 HOT 1
- C++调用callByUFunction 有异常崩溃 HOT 1
- cppbinding问题 HOT 2
- REG_EXTENSION_PROPERTY 使用无效 HOT 4
- Tick函数不会调用 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sluaunreal.