feat(test): add real UE 5.8 RunLuaTests commandlet, Lua.RunTests command, and fix UnLua .d.ts math/UObject bugs

This commit is contained in:
szy73711 committed 2026-11-29 15:05:35 +08:00
1 parent 3dd61c32a9
commit 96e3f0d009
29 files changed
+1417 -134

No files matched your search

@@ -2,14 +2,14 @@ local Ex09_AssetRefAndUMG = UnLua.Class()
function Ex09_AssetRefAndUMG.Initialize(self, _Initializer)
self.isConstructed = false
self.isDestructed = false
self.weakRef = UE.FWeakObjectPtr()
self.weakRef = nil
end
function Ex09_AssetRefAndUMG.Construct(self)
self.isConstructed = true
self.loadedAsset = UE.UObject.Load("/Game/UI/Textures/T_Icon.T_Icon")
if self.loadedAsset ~= nil then
self.refProxy = UnLua.Ref(self.loadedAsset)
self.weakRef:Set(self.loadedAsset)
self.weakRef = UE.FWeakObjectPtr(self.loadedAsset)
end
end
function Ex09_AssetRefAndUMG.ShowOnScreen(self)
@@ -30,10 +30,13 @@ function Ex09_AssetRefAndUMG.Destruct(self)
self.refProxy = nil
self.loadedAsset = nil
end
self.weakRef:Reset()
if self.weakRef ~= nil then
self.weakRef:Reset()
self.weakRef = nil
end
end
function Ex09_AssetRefAndUMG.HasValidWeakAsset(self)
return self.weakRef:IsValid()
return self.weakRef ~= nil and self.weakRef:IsValid()
end
function Ex09_AssetRefAndUMG.IsConstructed(self)
return self.isConstructed