GSServer-CBT/soggy_resources/lua/UAuto/Base/UAutoCoroutine.lua

21 lines
542 B
Lua
Raw Normal View History

2022-11-21 11:30:31 +03:00
local util = require ('Base/util')
local cs_coroutine_runner = nil
if AutoTestObject ~= nil then
cs_coroutine_runner = CS.UnityEngine.GameObject.Find("AutoTestObject"):GetComponent("AutoTestDriver")
end
if AutoTestObject == nil then
cs_coroutine_runner = CS.UnityEngine.GameObject.Find("GameManager"):GetComponent("AutoTestDriver")
end
local function async_yield_return(to_yield, cb)
print(to_yield)
cs_coroutine_runner:YieldAndCallback(to_yield, cb)
end
return {
yield_return = util.async_to_sync(async_yield_return)
}