Beispiel #1
0
    public static Delegate UICamera_VectorDelegate(LuaFunction func)
    {
        if (func == null)
        {
            UICamera.VectorDelegate fn = delegate { };
            return(fn);
        }

        UICamera.VectorDelegate d = (new UICamera_VectorDelegate_Event(func)).Call;
        return(d);
    }
Beispiel #2
0
 public static Delegate UICamera_VectorDelegate(LuaFunction func)
 {
     UICamera.VectorDelegate d = (param0, param1) =>
     {
         int    top = func.BeginPCall();
         IntPtr L   = func.GetLuaState();
         LuaScriptMgr.Push(L, param0);
         LuaScriptMgr.Push(L, param1);
         func.PCall(top, 2);
         func.EndPCall(top);
     };
     return(d);
 }
Beispiel #3
0
        static internal int checkDelegate(IntPtr l, int p, out UICamera.VectorDelegate ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, p))
            {
                ua = null;
                return(op);
            }
            else if (LuaDLL.lua_isuserdata(l, p) == 1)
            {
                ua = (UICamera.VectorDelegate)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            if (ld.d != null)
            {
                ua = (UICamera.VectorDelegate)ld.d;
                return(op);
            }
            LuaDLL.lua_pop(l, 1);

            l  = LuaState.get(l).L;
            ua = (UnityEngine.GameObject a1, UnityEngine.Vector2 a2) =>
            {
                int error = pushTry(l);

                pushValue(l, a1);
                pushValue(l, a2);
                ld.pcall(2, error);
                LuaDLL.lua_settop(l, error - 1);
            };
            ld.d = ua;
            return(op);
        }