test: add comprehensive ts2lua-unreal TS/Lua 5.4 test suites and upgrade to v0.2.2
This commit is contained in:
1 parent
ee2e62bb34
commit
3dd61c32a9
75 files changed
+9929
-10
No files matched your search
@@ -0,0 +1,37 @@
|
||||
local Ex07_CallLatentFunction = UnLua.Class()
|
||||
function Ex07_CallLatentFunction.ReceiveBeginPlay(self)
|
||||
self.Overridden.ReceiveBeginPlay(self)
|
||||
self.steps = {}
|
||||
self.completed = false
|
||||
local co = coroutine.create(function(actor)
|
||||
actor:RunSequence()
|
||||
end)
|
||||
local ok, err = coroutine.resume(co, self)
|
||||
if not ok then
|
||||
UnLua.LogError(
|
||||
"Ex07 coroutine failed:",
|
||||
tostring(err)
|
||||
)
|
||||
end
|
||||
end
|
||||
function Ex07_CallLatentFunction.RunSequence(self)
|
||||
self.steps[#self.steps + 1] = "Step1:Start"
|
||||
UE.UKismetSystemLibrary.Delay(self, 0.5)
|
||||
if not UE.UKismetSystemLibrary.IsValid(self) then
|
||||
return
|
||||
end
|
||||
self.steps[#self.steps + 1] = "Step2:After0.5s"
|
||||
UE.UKismetSystemLibrary.Delay(self, 1)
|
||||
if not UE.UKismetSystemLibrary.IsValid(self) then
|
||||
return
|
||||
end
|
||||
self.steps[#self.steps + 1] = "Step3:Done"
|
||||
self.completed = true
|
||||
end
|
||||
function Ex07_CallLatentFunction.GetSteps(self)
|
||||
return self.steps
|
||||
end
|
||||
function Ex07_CallLatentFunction.IsCompleted(self)
|
||||
return self.completed
|
||||
end
|
||||
return Ex07_CallLatentFunction
|
||||
Reference in new issue
Block a user