public void XMove(LuaThread thread, object val, int index = 1) { int oldTop = _luaState.GetTop(); _translator.Push(_luaState, val); _luaState.XMove(thread.State, index); _luaState.SetTop(oldTop); }
/* * Creates a new empty thread */ public LuaState NewThread(out LuaThread thread) { int oldTop = _luaState.GetTop(); LuaState state = _luaState.NewThread(); thread = (LuaThread)_translator.GetObject(_luaState, -1); _luaState.SetTop(oldTop); return(state); }
/* * Creates a new coroutine thread */ public LuaState NewThread(LuaFunction function, out LuaThread thread) { int oldTop = _luaState.GetTop(); LuaState state = _luaState.NewThread(); thread = (LuaThread)_translator.GetObject(_luaState, -1); _translator.Push(_luaState, function); _luaState.XMove(state, 1); _luaState.SetTop(oldTop); return(state); }