Esempio n. 1
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "HashEncrypt",
            "DeleteFile",
            "DeleteAllGameObject",
            "HideAllCam",
            "NotificationMessage",
            "CleanNotification",
            "NotificationMessageAddSeconds"
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            HashEncrypt,
            DeleteFile,
            DeleteAllGameObject,
            HideAllCam,
            NotificationMessage,
            CleanNotification,
            NotificationMessageAddSeconds,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 2
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "AddChild",
            "AddChildWithPosition",
            "AddChildWithLocalPosition",
            "AddChildNotLose",
            "AddChildByResourcesPath",
            "AddChildNoBehaviour",
            "AddChildByResourcesPathNoBehaviour",
            "AddEffect",
            "AddEffectLocal",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            AddChild,
            AddChildWithPosition,
            AddChildWithLocalPosition,
            AddChildNotLose,
            AddChildByResourcesPath,
            AddChildNoBehaviour,
            AddChildByResourcesPathNoBehaviour,
            AddEffect,
            AddEffectLocal,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 3
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Create",
            "Vector3",
            "GetMagnitude",
            "Normalize",
            "x",
            "y",
            "z",
            "Equal",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Create,
            Vector3,
            GetMagnitude,
            Normalize,
            x,
            y,
            z,
            Equal,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 4
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Create",
            "Euler",
            "Identity",
            "x",
            "y",
            "z",
            "w",
            "Equal",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Create,
            Euler,
            Identity,
            Equal,
            x,
            y,
            z,
            w,
            Equal,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 5
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        Net  = new CNetWorkGlobal();
        string[] funcList = new string[]
        {
            "IsConnected",
            "Connect",
            "DisConnect",
            "SendNetMessage",
            "Update",
            "SetSocketSendNoDeley",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            IsConnected,
            Connect,
            DisConnect,
            SendNetMessage,
            Update,
            SetSocketSendNoDeley,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 6
0
 public LuaState(IntPtr lua)
 {
     this.luaPtr      = lua;
     globalLuaState   = this;
     this.pfnPanic    = LuaState.Lua_Panic;
     this.pfnDispatch = LuaState.Lua_DispatchFun;
     LuaAPI.lua_atpanic(this.luaPtr, this.pfnPanic);
 }
Esempio n. 7
0
 public LuaState(IntPtr lua)
 {
     this.m_lua         = lua;
     m_GlobalState      = this;
     this.m_pfnPanic    = LuaState.Lua_Panic;
     this.m_pfnDispatch = LuaState.Lua_DispatchFun;
     LuaAPI.lua_atpanic(this.m_lua, this.m_pfnPanic);
 }
Esempio n. 8
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = LuaInstance.instance.Get();
        string[] funcList = new string[]
        {
            "logtest",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            logtest,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 9
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "SetLuaTableField",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            SetLuaTableField,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 10
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);
        }
Esempio n. 11
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);
        }
Esempio n. 12
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Get",
            "Equal",
            "StringToColor",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Get,
            Equal,
            StringToColor,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 13
0
    public void RegisterFuncByMethodInfo(String funcName, MethodInfo m, LuaAPI.lua_CFunction cfunc)
    {
        if (m == null)
        {
            return; // FIX add warnning
        }
        else
        {
            methods_.Add(m);
            paramters_.Add(m.GetParameters());

            int a = LuaInstance.MergeInt(register_funtion_, classIndex);
            lua_.PushInteger(a);
            lua_.PushLuaClosure(cfunc, 1);
            lua_.SetField(-2, funcName);
            register_funtion_++;
        }
    }
Esempio n. 14
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);
        }
Esempio n. 15
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Get",
            "GetBySeconds",
            "GetServerSeconds",
            "GetWithTimeZone",
            "GetSecondsLeft",
            "GetByServerSeconds",
            "GetClientTimeByServerSeconds",
            "GetClientNowTime",
            "Ticks_197011",
            "Ticks_UtcNow",
            "Ticks_Now",
            "LongAdd",
            "LongSub",
            "LongMultiply",
            "LongDivide",
            "LongLess",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Get,
            GetBySeconds,
            GetServerSeconds,
            GetWithTimeZone,
            GetSecondsLeft,
            GetByServerSeconds,
            GetClientTimeByServerSeconds,
            GetClientNowTime,
            Ticks_197011,
            Ticks_UtcNow,
            Ticks_Now,
            LongAdd,
            LongSub,
            LongMultiply,
            LongDivide,
            LongLess,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 16
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Get",
            "GetByParams",
            "GetByComplexParams",
            "IsSameType",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Get,
            GetByParams,
            GetByComplexParams,
            IsSameType,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 17
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "Log",
            "LogError",
            "Log3Error",
            "LogLong",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            Log,
            LogError,
            Log3Error,
            LogLong,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 18
0
    public static void RegisterToLua(LuaState lua, Type type)
    {
        lua_ = lua;
        string[] funcList = new string[]
        {
            "ShowLong",
            "ShowLableWithLong",
            "ToString",
            "GetDataLong",
        };

        LuaAPI.lua_CFunction[] funcDeList = new LuaAPI.lua_CFunction[]
        {
            ShowLong,
            ShowLableWithLong,
            ToString,
            GetDataLong,
        };
        LuaWrapper.RegisterToLua(lua, type, funcList, funcDeList);
    }
Esempio n. 19
0
        private void RegisterField()
        {
            fields = registerType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static);

            if (fields == null)
            {
                return;
            }
            else
            {
                LuaAPI.lua_CFunction cfunc = LuaInstance.SetField;

                for (int i = 0; i < fields.Length; i++)
                {
                    int a = LuaInstance.MergeInt(fieldIndex, classIndex);
                    lua.PushInteger(a);
                    lua.PushLuaClosure(cfunc, 1);
                    lua.SetField(-2, fields[i].Name);

                    fieldIndex++;
                }
            }
        }
Esempio n. 20
0
    public void RegisterField()
    {
        fields_ = register_type_.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static);

        if (fields_ == null)
        {
            return; // FIX add warnning
        }
        else
        {
            LuaAPI.lua_CFunction cfunc = LuaInstance.SetField;

            for (int i = 0; i < fields_.Length; i++)
            {
                int a = LuaInstance.MergeInt(field_index_, classIndex);
                lua_.PushInteger(a);
                lua_.PushLuaClosure(cfunc, 1);
                lua_.SetField(-2, fields_[i].Name);

                field_index_++;
            }
        }
    }
Esempio n. 21
0
 public void PushLuaClosure(LuaAPI.lua_CFunction func, int n)
 {
     LuaAPI.lua_pushcclosure(this.luaPtr, func, n);
 }
Esempio n. 22
0
 public void RegisterFunc(string funcName, LuaAPI.lua_CFunction func, int paraNum)
 {
     lua_.PushLuaClosure(func, paraNum);
     lua_.SetGlobal(funcName);
 }