Exemple #1
0
        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);
        }
Exemple #2
0
        /*
         * 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);
        }
Exemple #3
0
        /*
         * 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);
        }