Пример #1
0
    static int GetType(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(NTGLuaScript)))
            {
                NTGLuaScript obj = (NTGLuaScript)ToLua.ToObject(L, 1);
                System.Type  o   = obj.GetType();
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(string)))
            {
                string      arg0 = ToLua.ToString(L, 1);
                System.Type o    = NTGLuaScript.GetType(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: NTGLuaScript.GetType"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Пример #2
0
 static int OnEnable(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NTGLuaScript obj = (NTGLuaScript)ToLua.CheckObject(L, 1, typeof(NTGLuaScript));
         obj.OnEnable();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #3
0
 static int Load(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGLuaScript obj  = (NTGLuaScript)ToLua.CheckObject(L, 1, typeof(NTGLuaScript));
         string       arg0 = ToLua.CheckString(L, 2);
         obj.Load(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #4
0
 static int OnTriggerExit(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGLuaScript         obj  = (NTGLuaScript)ToLua.CheckObject(L, 1, typeof(NTGLuaScript));
         UnityEngine.Collider arg0 = (UnityEngine.Collider)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Collider));
         obj.OnTriggerExit(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #5
0
 static int LuaCall(IntPtr L)
 {
     try
     {
         int          count = LuaDLL.lua_gettop(L);
         NTGLuaScript obj   = (NTGLuaScript)ToLua.CheckObject(L, 1, typeof(NTGLuaScript));
         string       arg0  = ToLua.CheckString(L, 2);
         object[]     arg1  = ToLua.ToParamsObject(L, 3, count - 2);
         obj.LuaCall(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #6
0
 static int InvokeDelegate(IntPtr L)
 {
     try
     {
         int             count = LuaDLL.lua_gettop(L);
         NTGLuaScript    obj   = (NTGLuaScript)ToLua.CheckObject(L, 1, typeof(NTGLuaScript));
         System.Delegate arg0  = (System.Delegate)ToLua.CheckObject(L, 2, typeof(System.Delegate));
         object[]        arg1  = ToLua.ToParamsObject(L, 3, count - 2);
         object          o     = obj.InvokeDelegate(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #7
0
    static int set_module(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj  = (NTGLuaScript)o;
            string       arg0 = ToLua.CheckString(L, 2);
            obj.module = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index module on a nil value" : e.Message));
        }
    }
Пример #8
0
    static int set_self(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj  = (NTGLuaScript)o;
            LuaTable     arg0 = ToLua.CheckLuaTable(L, 2);
            obj.self = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index self on a nil value" : e.Message));
        }
    }
Пример #9
0
    static int set_eventOnTriggerExit(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj  = (NTGLuaScript)o;
            bool         arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.eventOnTriggerExit = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index eventOnTriggerExit on a nil value" : e.Message));
        }
    }
Пример #10
0
    static int set_ints(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj  = (NTGLuaScript)o;
            int[]        arg0 = ToLua.CheckNumberArray <int>(L, 2);
            obj.ints = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ints on a nil value" : e.Message));
        }
    }
Пример #11
0
    static int set_transforms(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript            obj  = (NTGLuaScript)o;
            UnityEngine.Transform[] arg0 = ToLua.CheckObjectArray <UnityEngine.Transform>(L, 2);
            obj.transforms = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index transforms on a nil value" : e.Message));
        }
    }
Пример #12
0
    static int get_module(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj = (NTGLuaScript)o;
            string       ret = obj.module;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index module on a nil value" : e.Message));
        }
    }
Пример #13
0
    static int get_self(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript          obj = (NTGLuaScript)o;
            LuaInterface.LuaTable ret = obj.self;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index self on a nil value" : e.Message));
        }
    }
Пример #14
0
    static int get_eventOnTriggerExit(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj = (NTGLuaScript)o;
            bool         ret = obj.eventOnTriggerExit;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index eventOnTriggerExit on a nil value" : e.Message));
        }
    }
Пример #15
0
    static int get_ints(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript obj = (NTGLuaScript)o;
            int[]        ret = obj.ints;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ints on a nil value" : e.Message));
        }
    }
Пример #16
0
    static int get_transforms(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGLuaScript            obj = (NTGLuaScript)o;
            UnityEngine.Transform[] ret = obj.transforms;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index transforms on a nil value" : e.Message));
        }
    }