Ejemplo n.º 1
0
    static int SetEase(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(ToLua_DG_Tweening_Tween), typeof(DG.Tweening.EaseFunction)))
            {
                ToLua_DG_Tweening_Tween  obj  = (ToLua_DG_Tweening_Tween)ToLua.ToObject(L, 1);
                DG.Tweening.EaseFunction arg0 = null;
                LuaTypes funcType2            = LuaDLL.lua_type(L, 2);

                if (funcType2 != LuaTypes.LUA_TFUNCTION)
                {
                    arg0 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 2);
                    arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.EaseFunction), func) as DG.Tweening.EaseFunction;
                }

                DG.Tweening.Tween o = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(ToLua_DG_Tweening_Tween), typeof(UnityEngine.AnimationCurve)))
            {
                ToLua_DG_Tweening_Tween    obj  = (ToLua_DG_Tweening_Tween)ToLua.ToObject(L, 1);
                UnityEngine.AnimationCurve arg0 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2);
                DG.Tweening.Tween          o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(ToLua_DG_Tweening_Tween), typeof(DG.Tweening.Ease)))
            {
                ToLua_DG_Tweening_Tween obj  = (ToLua_DG_Tweening_Tween)ToLua.ToObject(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2);
                DG.Tweening.Tween       o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(ToLua_DG_Tweening_Tween), typeof(DG.Tweening.Ease), typeof(float)))
            {
                ToLua_DG_Tweening_Tween obj  = (ToLua_DG_Tweening_Tween)ToLua.ToObject(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2);
                float             arg1       = (float)LuaDLL.lua_tonumber(L, 3);
                DG.Tweening.Tween o          = obj.SetEase(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(ToLua_DG_Tweening_Tween), typeof(DG.Tweening.Ease), typeof(float), typeof(float)))
            {
                ToLua_DG_Tweening_Tween obj  = (ToLua_DG_Tweening_Tween)ToLua.ToObject(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2);
                float             arg1       = (float)LuaDLL.lua_tonumber(L, 3);
                float             arg2       = (float)LuaDLL.lua_tonumber(L, 4);
                DG.Tweening.Tween o          = obj.SetEase(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ToLua_DG_Tweening_Tween.SetEase"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }