local Input = UnityEngine.Input
local KeyCode = UnityEngine.KeyCode
--主入口函数。从这里开始lua逻辑
function Main()
print("logic start")
UpdateBeat:Add(Update, self)
FixedUpdateBeat:Add(FixedUpdate, self)
--LateUpdateBeat
CreateGo()
end
--场景切换通知
function OnLevelWasLoaded(level)
collectgarbage("collect")
Time.timeSinceLevelLoad = 0
end
function OnApplicationQuit()
end
function Update()
-- print("update...")
if Input.GetKey(KeyCode.A) then
print("press A")
elseif Input.GetKey(KeyCode.B) then
print("press B")
end
end
function FixedUpdate()
-- print("FixedUpdate...")
end
function CreateGo()
local go1 = UnityEngine.GameObject("test")
go1.name = "test_go1"
local go2 = UnityEngine.GameObject("test_go2", typeof(UnityEngine.BoxCollider))
end