コード例 #1
0
        internal static int _Execute(LuaState luaState)
        {
            var index = (int)LuaLib.LuaToNumber(luaState, LuaLib.LuaNetUpValueIndex(1));

            if (index >= 0 && index < LuaExecuter.executers.Count)
            {
                var executer = LuaExecuter.executers[index];
                executer.luaState   = luaState;
                executer.execOutput = 0;
                executer.function(executer);
                if (executer.execOutput != executer.output)
                {
                    Logger <ILuaRuntime> .W("Method return count is incorrect since the definition is " + executer.output + ", but " + executer.execOutput + " is returned!");
                }
                return((int)executer.execOutput);
            }
            else
            {
                Logger <ILuaRuntime> .E("Can't find related C# function!");

                return(0);
            }
        }