在未来版本移除lua的Initialize方法支持 #564
xuyanghuang-tencent
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在收到UE的
NotifyUObjectCreated通知时,UObject还没有构造完,此时如果在lua的Initialize方法里调用这个对象上的UFUNCTION会引起check。另外目前Initialize的参数还承载着动态绑定的传参作用,不好直接移除或替换实现。Construct方法UClass::ClassConstructor,勾住UObject的构造事件,来保证UObject被正确构造之后再去lua里调用脚本构造方法,这样就能正常调用这个对象上的UFunction了。UFUNCTION不能冲突,目前看叫Construct比较合适。M.__ConstructorName = "LuaConstructor"。UNLUA_LEGACY_INITIALIZER来保持原来的Initialize机制未来2.4版本默认关闭
实现分支:feature/constructor
Beta Was this translation helpful? Give feedback.
All reactions