1、lua代码提示功能: ctags lua增强, 配置参考ctags FILES
ctags for sublime text
ctags for atom
2、lua定时器实现
public static void UnityCoroutine(YieldInstruction ins, LuaFunction func)
{
Main.instance.StartCoroutine (doCoroutine (ins, func));
}
private static IEnumerator doCoroutine(YieldInstruction ins, LuaFunction func)
{
yield return ins;
func.Call ();
}
Main = using "Main"
local WaitForSeconds = using "UnityEngine.WaitForSeconds"
local UnityCoroutine = Main.UnityCoroutine
function SetTimeout(func, sec)
UnityCoroutine(WaitForSeconds(sec), coroutine.wrap(func))
end
|
请发表评论