仅在instance配置lua path,不能绑定脚本
gunsungithub opened this issue · comments
LeonZhao commented
Describe the bug
将lua路径默认值为空的lua actor子类放入场景,在场景中修改其lua路径,不会执行lua版本的函数。
Version
lua 2.0.1
UE 5.1
To Reproduce
如题,并在关卡蓝图中执行该函数
class DEMOCPP_API AMyLuaActor : public ALuaActor
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void MyNaciveFunctionLua(float FloatParameter, int32 IntParameter);
void MyNaciveFunctionLua_Implementation(float FloatParameter, int32 IntParameter);
};
local MyLuaActor = {}
function MyLuaActor:MyNaciveFunctionLua(float, int)
print("called from MyNaciveFunctionLua",float, int)
end
local CLuaActor = require("LuaActor")
return Class(CLuaActor, nil, MyLuaActor)
Expected behavior
执行lua版本的函数
Desktop (please complete the following information):
- OS: Windows
Additional context
我调试发现,在绑定时,路径信息还没有。如果时CDO中配置路径就没问题。
如果认为这样做不是正确的配置方法,可以改为feature。
LeonZhao commented
貌似可以用virtual void PostDuplicate(bool bDuplicateForPIE) {}处理一下
zjhongxian commented
动态在场景里面修改设置应该是还没能支持
zjhongxian commented
动态在场景里面修改设置应该是还没能支持
我得空看看能不能支持下,不过我近段时间赶业务,可能要稍晚些