lua_pushnumber() private method

private lua_pushnumber ( IntPtr luaState, double number ) : void
luaState System.IntPtr
number double
return void
示例#1
0
 public void Push(IntPtr L, ushort n)
 {
     LuaDLL.lua_pushnumber(L, n);
 }
示例#2
0
 public void Push(IntPtr L, byte n)
 {
     LuaDLL.lua_pushnumber(L, n);
 }
示例#3
0
 public void LuaPushInteger(int n)
 {
     LuaDLL.lua_pushnumber(L, n);
 }
示例#4
0
 public void LuaPushNumber(double number)
 {
     LuaDLL.lua_pushnumber(L, number);
 }
示例#5
0
 public void Push(IntPtr L, decimal n)
 {
     LuaDLL.lua_pushnumber(L, (double)n);
 }
示例#6
0
        public static void Push(IntPtr L, object obj)
        {
            if (obj == null)
            {
                LuaDLL.lua_pushnil(L);
                return;
            }
            Type type = obj.GetType();

            if (type.get_IsValueType())
            {
                if (type == typeof(bool))
                {
                    bool value = (bool)obj;
                    LuaDLL.lua_pushboolean(L, value);
                }
                else if (type.get_IsEnum())
                {
                    ToLua.Push(L, (Enum)obj);
                }
                else if (type.get_IsPrimitive())
                {
                    double number = LuaMisc.ToDouble(obj);
                    LuaDLL.lua_pushnumber(L, number);
                }
                else if (type == typeof(Vector3))
                {
                    ToLua.Push(L, (Vector3)obj);
                }
                else if (type == typeof(Quaternion))
                {
                    ToLua.Push(L, (Quaternion)obj);
                }
                else if (type == typeof(Vector2))
                {
                    ToLua.Push(L, (Vector2)obj);
                }
                else if (type == typeof(Vector4))
                {
                    ToLua.Push(L, (Vector4)obj);
                }
                else if (type == typeof(Color))
                {
                    ToLua.Push(L, (Color)obj);
                }
                else if (type == typeof(RaycastHit))
                {
                    ToLua.Push(L, (RaycastHit)obj);
                }
                else if (type == typeof(Touch))
                {
                    ToLua.Push(L, (Touch)obj);
                }
                else if (type == typeof(Ray))
                {
                    ToLua.Push(L, (Ray)obj);
                }
                else if (type == typeof(Bounds))
                {
                    ToLua.Push(L, (Bounds)obj);
                }
                else if (type == typeof(LayerMask))
                {
                    ToLua.PushLayerMask(L, (LayerMask)obj);
                }
                else
                {
                    ToLua.PushValue(L, (ValueType)obj);
                }
            }
            else if (type.get_IsArray())
            {
                ToLua.Push(L, (Array)obj);
            }
            else if (type == typeof(string))
            {
                LuaDLL.lua_pushstring(L, (string)obj);
            }
            else if (type.IsSubclassOf(typeof(LuaBaseRef)))
            {
                ToLua.Push(L, (LuaBaseRef)obj);
            }
            else if (type.IsSubclassOf(typeof(Object)))
            {
                ToLua.Push(L, (Object)obj);
            }
            else if (type.IsSubclassOf(typeof(TrackedReference)))
            {
                ToLua.Push(L, (TrackedReference)obj);
            }
            else if (type == typeof(LuaByteBuffer))
            {
                LuaByteBuffer luaByteBuffer = (LuaByteBuffer)obj;
                LuaDLL.lua_pushlstring(L, luaByteBuffer.buffer, luaByteBuffer.buffer.Length);
            }
            else if (type.IsSubclassOf(typeof(Delegate)))
            {
                ToLua.Push(L, (Delegate)obj);
            }
            else if (obj is IEnumerator)
            {
                ToLua.Push(L, (IEnumerator)obj);
            }
            else if (type == typeof(EventObject))
            {
                ToLua.Push(L, (EventObject)obj);
            }
            else if (type == ToLua.monoType)
            {
                ToLua.Push(L, (Type)obj);
            }
            else
            {
                ToLua.PushObject(L, obj);
            }
        }