test: add comprehensive ts2lua-unreal TS/Lua 5.4 test suites and upgrade to v0.2.2

This commit is contained in:
szy73711 committed 2026-11-29 03:35:49 +08:00
1 parent ee2e62bb34
commit 3dd61c32a9
75 files changed
+9929 -10

No files matched your search

@@ -0,0 +1,73 @@
local Ex05_BindInputs = UnLua.Class()
function Ex05_BindInputs.ReceiveBeginPlay(self)
self.Overridden.ReceiveBeginPlay(self)
self.lastAction = ""
self.moveForwardValue = 0
self.enhancedCount = 0
end
function Ex05_BindInputs.HandleSpacePressed(self)
self.lastAction = "SpaceBar:Pressed"
end
function Ex05_BindInputs.HandleCtrlSave(self)
self.lastAction = "Ctrl+S"
end
function Ex05_BindInputs.HandleJumpAction(self)
self.lastAction = "Action:Jump"
end
function Ex05_BindInputs.HandleMoveForward(self, axisValue)
self.moveForwardValue = axisValue
end
function Ex05_BindInputs.HandleEnhancedMove(self, actionValue)
self.enhancedCount = self.enhancedCount + 1
self.moveForwardValue = actionValue
end
function Ex05_BindInputs.GetLastAction(self)
return self.lastAction
end
function Ex05_BindInputs.GetMoveForwardValue(self)
return self.moveForwardValue
end
function Ex05_BindInputs.GetEnhancedCount(self)
return self.enhancedCount
end
UnLua.Input.BindKey(
Ex05_BindInputs,
"SpaceBar",
"Pressed",
function(self)
self:HandleSpacePressed()
end
)
UnLua.Input.BindKey(
Ex05_BindInputs,
"S",
"Pressed",
function(self)
self:HandleCtrlSave()
end,
{Ctrl = true}
)
UnLua.Input.BindAction(
Ex05_BindInputs,
"Jump",
"Pressed",
function(self)
self:HandleJumpAction()
end
)
UnLua.Input.BindAxis(
Ex05_BindInputs,
"MoveForward",
function(self, axisValue)
self:HandleMoveForward(axisValue)
end
)
UnLua.EnhancedInput.BindAction(
Ex05_BindInputs,
"/Game/Input/IA_Move.IA_Move",
"Triggered",
function(self, actionValue)
self:HandleEnhancedMove(actionValue)
end
)
return Ex05_BindInputs