Ejemplo n.º 1
0
    static int CopyGameObject(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(UnityEngine.Transform)))
            {
                Game.Utils             obj  = (Game.Utils)ToLua.ToObject(L, 1);
                UnityEngine.Transform  arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 2);
                UnityEngine.GameObject o    = obj.CopyGameObject(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(UnityEngine.GameObject)))
            {
                Game.Utils             obj  = (Game.Utils)ToLua.ToObject(L, 1);
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 2);
                UnityEngine.GameObject o    = obj.CopyGameObject(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Game.Utils.CopyGameObject"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
    static int MD5(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(byte[])))
            {
                Game.Utils obj  = (Game.Utils)ToLua.ToObject(L, 1);
                byte[]     arg0 = ToLua.CheckByteBuffer(L, 2);
                string     o    = obj.MD5(arg0);
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(string)))
            {
                Game.Utils obj  = (Game.Utils)ToLua.ToObject(L, 1);
                string     arg0 = ToLua.ToString(L, 2);
                string     o    = obj.MD5(arg0);
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Game.Utils.MD5"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 3
0
    static int SaveFile(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(string), typeof(byte[])))
            {
                Game.Utils obj  = (Game.Utils)ToLua.ToObject(L, 1);
                string     arg0 = ToLua.ToString(L, 2);
                byte[]     arg1 = ToLua.CheckByteBuffer(L, 3);
                obj.SaveFile(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(Game.Utils), typeof(string), typeof(string)))
            {
                Game.Utils obj  = (Game.Utils)ToLua.ToObject(L, 1);
                string     arg0 = ToLua.ToString(L, 2);
                string     arg1 = ToLua.ToString(L, 3);
                obj.SaveFile(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Game.Utils.SaveFile"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 4
0
 static int OpenApp(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Game.Utils obj  = (Game.Utils)ToLua.CheckObject(L, 1, typeof(Game.Utils));
         string     arg0 = ToLua.CheckString(L, 2);
         obj.OpenApp(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 5
0
 static int ReadFile(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Game.Utils obj  = (Game.Utils)ToLua.CheckObject(L, 1, typeof(Game.Utils));
         string     arg0 = ToLua.CheckString(L, 2);
         string     o    = obj.ReadFile(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 6
0
    static int get_milliseconds(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Game.Utils obj = (Game.Utils)o;
            long       ret = obj.milliseconds;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index milliseconds on a nil value" : e.Message));
        }
    }
Ejemplo n.º 7
0
    static int get_platform(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Game.Utils obj = (Game.Utils)o;
            string     ret = obj.platform;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index platform on a nil value" : e.Message));
        }
    }
Ejemplo n.º 8
0
    static int _CreateGame_Utils(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Game.Utils obj = new Game.Utils();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Game.Utils.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }