예제 #1
0
        static PlayerLoopSystem[] InsertUniTaskSynchronizationContext(PlayerLoopSystem loopSystem)
        {
            var loop = new PlayerLoopSystem
            {
                type           = typeof(UniTaskSynchronizationContext),
                updateDelegate = UniTaskSynchronizationContext.Run
            };

            // Remove items from previous initializations.
            var source = loopSystem.subSystemList
                         .Where(ls => ls.type != typeof(UniTaskSynchronizationContext))
                         .ToArray();

            var dest = new System.Collections.Generic.List <PlayerLoopSystem>(source);

            var index = dest.FindIndex(x => x.type.Name == "ScriptRunDelayedTasks");

            if (index == -1)
            {
                index = dest.FindIndex(x => x.type.Name == "UniTaskLoopRunnerUpdate");
            }

            dest.Insert(index + 1, loop);

            return(dest.ToArray());
        }
 static public int FindIndex(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             System.Collections.Generic.List <System.Int32> self = (System.Collections.Generic.List <System.Int32>)checkSelf(l);
             System.Predicate <System.Int32> a1;
             LuaDelegation.checkDelegate(l, 2, out a1);
             var ret = self.FindIndex(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             System.Collections.Generic.List <System.Int32> self = (System.Collections.Generic.List <System.Int32>)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Predicate <System.Int32> a2;
             LuaDelegation.checkDelegate(l, 3, out a2);
             var ret = self.FindIndex(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             System.Collections.Generic.List <System.Int32> self = (System.Collections.Generic.List <System.Int32>)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Predicate <System.Int32> a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             var ret = self.FindIndex(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int FindIndex(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <string>));
                System.Predicate <string> arg0 = (System.Predicate <string>)ToLua.CheckDelegate <System.Predicate <string> >(L, 2);
                int o = obj.FindIndex(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3)
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <string>));
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                System.Predicate <string> arg1 = (System.Predicate <string>)ToLua.CheckDelegate <System.Predicate <string> >(L, 3);
                int o = obj.FindIndex(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 4)
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <string>));
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                System.Predicate <string> arg2 = (System.Predicate <string>)ToLua.CheckDelegate <System.Predicate <string> >(L, 4);
                int o = obj.FindIndex(arg0, arg1, arg2);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: System.Collections.Generic.List<string>.FindIndex"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int FindIndex(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry> self = (System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry>)checkSelf(l);
             System.Predicate <UnityEngine.EventSystems.EventTrigger.Entry> a1;
             LuaDelegation.checkDelegate(l, 2, out a1);
             var ret = self.FindIndex(a1);
             pushValue(l, ret);
             return(1);
         }
         else if (argc == 3)
         {
             System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry> self = (System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry>)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Predicate <UnityEngine.EventSystems.EventTrigger.Entry> a2;
             LuaDelegation.checkDelegate(l, 3, out a2);
             var ret = self.FindIndex(a1, a2);
             pushValue(l, ret);
             return(1);
         }
         else if (argc == 4)
         {
             System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry> self = (System.Collections.Generic.List <UnityEngine.EventSystems.EventTrigger.Entry>)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Predicate <UnityEngine.EventSystems.EventTrigger.Entry> a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             var ret = self.FindIndex(a1, a2, a3);
             pushValue(l, ret);
             return(1);
         }
         return(error(l, "No matched override function to call"));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 private bool IsCellInList(int row, int column)
 {
     return(mCellsToVisit.FindIndex((other) => other.Row == row && other.Column == column) >= 0);
 }
    static int FindIndex(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <string>), typeof(System.Predicate <string>)))
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.ToObject(L, 1);
                System.Predicate <string> arg0 = null;
                LuaTypes funcType2             = LuaDLL.lua_type(L, 2);

                if (funcType2 != LuaTypes.LUA_TFUNCTION)
                {
                    arg0 = (System.Predicate <string>)ToLua.ToObject(L, 2);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 2);
                    arg0 = DelegateFactory.CreateDelegate(typeof(System.Predicate <string>), func) as System.Predicate <string>;
                }

                int o = obj.FindIndex(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <string>), typeof(int), typeof(System.Predicate <string>)))
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.ToObject(L, 1);
                int arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                System.Predicate <string> arg1 = null;
                LuaTypes funcType3             = LuaDLL.lua_type(L, 3);

                if (funcType3 != LuaTypes.LUA_TFUNCTION)
                {
                    arg1 = (System.Predicate <string>)ToLua.ToObject(L, 3);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 3);
                    arg1 = DelegateFactory.CreateDelegate(typeof(System.Predicate <string>), func) as System.Predicate <string>;
                }

                int o = obj.FindIndex(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <string>), typeof(int), typeof(int), typeof(System.Predicate <string>)))
            {
                System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.ToObject(L, 1);
                int arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                int arg1 = (int)LuaDLL.lua_tonumber(L, 3);
                System.Predicate <string> arg2 = null;
                LuaTypes funcType4             = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (System.Predicate <string>)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(System.Predicate <string>), func) as System.Predicate <string>;
                }

                int o = obj.FindIndex(arg0, arg1, arg2);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: System.Collections.Generic.List<string>.FindIndex"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }