---@type A_C
local M = UnLua.Class()
function M:Initialize(Initializer)
if Initializer then
self.DDD = Initializer[0]
print("Construct: " .. self.DDD)
end
end
return M
以下为构造 A 的逻辑
local M = UnLua.Class()
function M:ReceiveBeginPlay()
local b_cls = UE.UClass.Load("/Game/Test/lua/A.A_C")
local params = {}
params[0] = 10.2
local b = NewObject(b_cls, self, nil, "Test.A", params)
print("Finished: " .. b.DDD)
end
return M
Actor A 定义初始化
以下为构造 A 的逻辑
构造完成后 DDD变量会被 蓝图中 DDD变量的默认值覆盖 ,导致Initialize不起作用