public static lua_tointeger ( IntPtr luaState, int index ) : int | ||
luaState | IntPtr | |
index | int | |
리턴 | int |
internal static int Equals(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); T arg0 = ToLua.CheckObject <T>(L, 1); int result0 = EnumToInt(arg0); int result1 = 0; if (TypeChecker.CheckTypes <T>(L, 2)) { T arg1 = ToLua.CheckObject <T>(L, 2); result1 = EnumToInt(arg1); } else if (TypeChecker.CheckTypes <int>(L, 2)) { result1 = (int)LuaDLL.lua_tointeger(L, 1); } LuaDLL.lua_pushboolean(L, result0 == result1); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public uint ToUInt32(IntPtr L, int stackPos) { long ret = LuaDLL.lua_tointeger(L, stackPos); #if UNITY_5_3_OR_NEWER Debug.Assert(ret >= uint.MinValue && ret <= uint.MaxValue); #endif return((uint)ret); }
public char ToChar(IntPtr L, int stackPos) { long ret = LuaDLL.lua_tointeger(L, stackPos); #if UNITY_5_3_OR_NEWER Debug.Assert(ret >= char.MinValue && ret <= char.MaxValue); #endif return((char)ret); }
public short ToInt16(IntPtr L, int stackPos) { long ret = LuaDLL.lua_tointeger(L, stackPos); #if UNITY_5_3_OR_NEWER Debug.Assert(ret >= short.MinValue && ret <= short.MaxValue); #endif return((short)ret); }
public byte ToByte(IntPtr L, int stackPos) { long ret = LuaDLL.lua_tointeger(L, stackPos); #if UNITY_5_3_OR_NEWER Debug.Assert(ret >= byte.MinValue && ret <= byte.MaxValue); #endif return((byte)ret); }
public static int luaL_checkinteger(IntPtr L, int stackPos) { int num = LuaDLL.lua_tointeger(L, stackPos); if (num == 0 && LuaDLL.lua_isnumber(L, stackPos) == 0) { LuaDLL.luaL_typerror(L, stackPos, "number", null); return(0); } return(num); }
public static char[] ToParamsChar(IntPtr L, int stackPos, int count) { char[] array = new char[count]; int i = 0; while (i < count) { char c = (char)LuaDLL.lua_tointeger(L, stackPos); array[i++] = c; stackPos++; } return(array); }
public Nullable <uint> ToNullUInt32(IntPtr L, int stackPos) { if (LuaDLL.lua_type(L, stackPos) == LuaTypes.LUA_TNIL) { return(null); } long ret = LuaDLL.lua_tointeger(L, stackPos); #if UNITY_5_3_OR_NEWER Debug.Assert(ret >= uint.MinValue && ret <= uint.MaxValue); #endif return((uint)ret); }
public static char[] ToParamsChar(IntPtr L, int stackPos, int count) { char[] buffer = new char[count]; int pos = 0; while (pos < count) { char c = (char)LuaDLL.lua_tointeger(L, stackPos); buffer[pos++] = c; ++stackPos; } return(buffer); }
static int CreatePrimitive(IntPtr L) { try { PrimitiveType type = (PrimitiveType)LuaDLL.lua_tointeger(L, 1); GameObject go = UnityEngine.GameObject.CreatePrimitive(type); LuaExtend.AddObject2Lua(L, go, null); return(1); } catch (Exception e) { return(LuaDLL.wluaL_error(L, e)); } }
internal static int IntToEnum(IntPtr L) { try { int arg0 = (int)LuaDLL.lua_tointeger(L, 1); T o = IntToEnumTransfer(arg0); ToLua.PushValue(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static char[] CheckParamsChar(IntPtr L, int stackPos, int count) { char[] array = new char[count]; int i = 0; while (i < count) { if (LuaDLL.lua_isnumber(L, stackPos) == 0) { LuaDLL.luaL_typerror(L, stackPos, "char", null); return(null); } array[i] = (char)LuaDLL.lua_tointeger(L, stackPos); i++; stackPos++; } return(array); }
public static char[] CheckParamsChar(IntPtr L, int stackPos, int count) { char[] buffer = new char[count]; int pos = 0; while (pos < count) { if (LuaDLL.lua_isnumber(L, stackPos) != 0) { buffer[pos] = (char)LuaDLL.lua_tointeger(L, stackPos); } else { LuaDLL.luaL_typerror(L, stackPos, "char"); return(null); } ++pos; ++stackPos; } return(buffer); }
public int LuaToInteger(int idx) { return(LuaDLL.lua_tointeger(L, idx)); }