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

@@ -10,19 +10,19 @@ end
function Ex08_StructAndTrace.ComputeVectorMath(self)
local a = UE.FVector(3, 4, 0)
local b = UE.FVector(0, 0, 12)
local c = a:Add(b)
local dot = a:Dot(b)
a:Add(b)
local dist = UE.FVector.Dist(
UE.FVector(0, 0, 0),
c
a
)
return c:Size(), dot, dist
return a:Size(), dot, dist
end
function Ex08_StructAndTrace.TraceForward(self, distance)
local origin = self:K2_GetActorLocation()
self._tmpStart:Set(origin.X, origin.Y, origin.Z)
self._tmpEnd:Set(origin.X + distance, origin.Y, origin.Z)
local bHit, hit = UE.UKismetSystemLibrary.LineTraceSingle(
local bHit, returnedHit = UE.UKismetSystemLibrary.LineTraceSingle(
self,
self._tmpStart,
self._tmpEnd,
@@ -33,8 +33,25 @@ function Ex08_StructAndTrace.TraceForward(self, distance)
self._tmpHit,
true
)
local hit = returnedHit or self._tmpHit
return bHit, hit.Distance, hit.ImpactPoint
end
function Ex08_StructAndTrace.TraceForwardMultiReturn(self, distance)
local origin = self:K2_GetActorLocation()
self._tmpStart:Set(origin.X, origin.Y, origin.Z)
self._tmpEnd:Set(origin.X + distance, origin.Y, origin.Z)
return UE.UKismetSystemLibrary.LineTraceSingle(
self,
self._tmpStart,
self._tmpEnd,
UE.ETraceTypeQuery.TraceTypeQuery1,
false,
self._ignoreActors,
UE.EDrawDebugTrace.None,
nil,
true
)
end
function Ex08_StructAndTrace.TeleportTo(self, x, y, z)
local target = UE.FVector(x, y, z)
local bMoved = self:K2_SetActorLocation(target, false, self._tmpHit, true)