资源大湿 发表于 2021-4-21 18:40

unity lua获取时间戳xlua

在lua脚本unity中: local onFrameTime =CS.UnityEngine.Time.time;--getLuaTime();--
                            coroutine.yield(CS.UnityEngine.WaitForEndOfFrame());
                            local perTime = CS.UnityEngine.Time.time-onFrameTime;在lua中获取时间戳:function getLuaTime()
    local socket = require "socket"
    local t0 = socket.gettime()
    return t0;
end--注意这里lua中获取的时间戳不准确
页: [1]
查看完整版本: unity lua获取时间戳xlua