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

+26
View File
@@ -0,0 +1,26 @@
local UETimerTestActor = UnLua.Class()
function UETimerTestActor.ReceiveBeginPlay(self)
self.Overridden.ReceiveBeginPlay(self)
self.timerCount = 0
self.timerHandle = UE.UKismetSystemLibrary.K2_SetTimerDelegate({self, self.OnTimerTick}, 0.1, true)
end
function UETimerTestActor.OnTimerTick(self)
if not UE.UKismetSystemLibrary.IsValid(self) then
return
end
self.timerCount = self.timerCount + 1
end
function UETimerTestActor.StopTimer(self)
UE.UKismetSystemLibrary.K2_ClearAndInvalidateTimerHandle(self, self.timerHandle)
end
function UETimerTestActor.GetTimerCount(self)
return self.timerCount
end
function UETimerTestActor.IsTimerActive(self)
return UE.UKismetSystemLibrary.K2_IsTimerActiveHandle(self, self.timerHandle)
end
function UETimerTestActor.ReceiveEndPlay(self, EndPlayReason)
self:StopTimer()
self.Overridden.ReceiveEndPlay(self, EndPlayReason)
end
return UETimerTestActor