private static int MyCallback(LuaState state) { LuaStackObject strObj = state.Stack(1); Console.WriteLine(strObj.GetString()); return(0); }
static bool GuardDoString(LuaState state, String text) { int ret = state.LoadString(text); if (ret != 0) { LuaStackObject errObj = new LuaStackObject(state, -1); state.Pop(); return false; } ret = state.PCall(0, -1, 0); if (ret != 0) { LuaStackObject errObj = new LuaStackObject(state, -1); state.Pop(); } return true; }
static bool GuardDoString(LuaState state, String text) { int ret = state.LoadString(text); if (ret != 0) { LuaStackObject errObj = new LuaStackObject(state, -1); state.Pop(); return(false); } ret = state.PCall(0, -1, 0); if (ret != 0) { LuaStackObject errObj = new LuaStackObject(state, -1); state.Pop(); } return(true); }