예제 #1
0
        private static int RegisterIngoreStatic(IntPtr l)
        {
            string className = lua.ToString(-1);

            LuaRegister.RegisterIngoreStatic(className);

            return(0);
        }
예제 #2
0
 static int applicationIsPlaying(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         bool o = LuaRegister.applicationIsPlaying();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #3
0
        public static void RegisterToLua(LuaState lua)
        {
            LuaRegisterWrapper.lua = lua;
            string[] funcList = new string[]
            {
                "RegisterClass",
                "RegisterIngoreStatic",
            };

            LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
            {
                RegisterClass,
                RegisterIngoreStatic,
            };
            LuaRegister.RegisterToLua(lua, "RegisterWrapper", funcList, funcDeList);
        }
예제 #4
0
        public static void RegisterToLua(LuaState l)
        {
            lua = l;
            string[] funcList = new string[]
            {
                "AddTimer",
                "RemoveTimer",
            };

            LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
            {
                AddTimer,
                RemoveTimer,
            };
            LuaRegister.RegisterToLua(l, "LuaTimerWheel", funcList, funcDeList);
        }
예제 #5
0
    static int set_type(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaRegister obj  = (LuaRegister)o;
            int         arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.type = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index type on a nil value"));
        }
    }
예제 #6
0
    static int get_id(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaRegister obj = (LuaRegister)o;
            int         ret = obj.id;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index id on a nil value"));
        }
    }
예제 #7
0
        public static void RegisterToLua(LuaState l)
        {
            lua = l;
            string[] funcList = new string[]
            {
                "Log",
                "LogError",
                "LogWarning",
            };

            LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
            {
                Log,
                LogError,
                LogWarning,
            };
            LuaRegister.RegisterToLua(l, "DebugLogger", funcList, funcDeList);
        }
예제 #8
0
        void doinit(IntPtr L, LuaSvrFlag flag)
        {
#if !SLUA_STANDALONE
            LuaTimer.reg(L);
#if UNITY_EDITOR
            if (UnityEditor.EditorApplication.isPlaying)
#endif
            LuaCoroutine.reg(L, lgo);
#endif
            LuaHelper.reg(L);
            LuaValueType.reg(L);
            LuaRegister.reg(L);
            if ((flag & LuaSvrFlag.LSF_EXTLIB) != 0)
            {
                LuaDLL.luaS_openextlibs(L);
            }
            if ((flag & LuaSvrFlag.LSF_3RDDLL) != 0)
            {
                Lua3rdDLL.open(L);
            }

#if !SLUA_STANDALONE
#if UNITY_EDITOR
            if (UnityEditor.EditorApplication.isPlaying)
            {
#endif
            lgo.state    = luaState;
            lgo.onUpdate = this.tick;
            lgo.init();
#if UNITY_EDITOR
        }
#endif
#endif

            inited = true;
        }
예제 #9
0
 public void unregister(LuaRegister v)
 {
     engine.Call("unregister", v);
 }
예제 #10
0
 void Start()
 {
     mLuaState.DoFile("lua/preload/regist.lua");
     LuaRegister.Register(mLuaState.L);
     mLuaState.DoFile("lua/main.lua");
 }