public static AnimData CustomMethodToVector2(AnimCustomMethodVector2 method, Vector2 from, Vector2 to,
                                                 float time             = 0.5f,
                                                 float delayTime        = 0,
                                                 InterpType interp      = InterpType.Default,
                                                 bool IsIgnoreTimeScale = false,
                                                 RepeatType repeatType  = RepeatType.Once,
                                                 int repeatCount        = -1,
                                                 AnimCallBack callBack  = null, object[] parameter = null)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.AnimType, AnimType.Custom_Vector2,
            AnimParamType.FromV2, from,
            AnimParamType.ToV2, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CustomMethodV2, method,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
示例#2
0
    public static AnimData CustomMethodToVector2(AnimCustomMethodVector2 method, Vector2 from, Vector2 to,
                                                 float time             = 0.5f,
                                                 float delayTime        = 0,
                                                 InterpType interp      = InterpType.Default,
                                                 bool IsIgnoreTimeScale = false,
                                                 RepeatType repeatType  = RepeatType.Once,
                                                 int repeatCount        = -1,
                                                 AnimCallBack callBack  = null, object[] parameter = null)
    {
        AnimData l_tmp = new AnimData();;

        l_tmp.m_animType       = AnimType.Custom_Vector2;
        l_tmp.m_fromV2         = from;
        l_tmp.m_toV2           = to;
        l_tmp.m_customMethodV2 = method;

        l_tmp.m_delayTime         = delayTime;
        l_tmp.m_totalTime         = time;
        l_tmp.m_interpolationType = interp;
        l_tmp.m_repeatType        = repeatType;
        l_tmp.m_repeatCount       = repeatCount;
        l_tmp.m_ignoreTimeScale   = IsIgnoreTimeScale;
        l_tmp.m_callBack          = callBack;
        l_tmp.m_parameter         = parameter;

        l_tmp.Init();

        GetInstance().animList.Add(l_tmp);
        return(l_tmp);
    }
示例#3
0
 /// <summary>
 /// 回收脚本时
 /// 初始化
 /// </summary>
 public void OnPush()
 {
     loopType          = LoopType.Once;
     easeType          = Ease.Linear;
     isPause           = false;
     isIgnoreTimeScale = false;
     delayTime         = 0;
     isDone            = false;
     currentTime       = 0;
     totalTime         = 0;
     loopCount         = -1;
     pathType          = PathType.Line;
     pathPoints        = null;
     currentStep       = 0;
     // m_floatContral = null;
     toTransform       = null;
     customMethodV3    = null;
     customMethodV2    = null;
     customMethodFloat = null;
     m_rectRransform   = null;
     m_transform       = null;
     curve             = null;
     pathPoints        = null;
     pathWeith         = null;
     m_oldColor.Clear();
     animCallBack  = null;
     animParameter = null;
 }
    static int CustomMethodToVector2(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 11);
            AnimCustomMethodVector2 arg0 = null;
            LuaTypes funcType1           = LuaDLL.lua_type(L, 1);

            if (funcType1 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (AnimCustomMethodVector2)ToLua.CheckObject(L, 1, typeof(AnimCustomMethodVector2));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 1);
                arg0 = DelegateFactory.CreateDelegate(typeof(AnimCustomMethodVector2), func) as AnimCustomMethodVector2;
            }

            UnityEngine.Vector2 arg1 = (UnityEngine.Vector2)ToLua.CheckObject(L, 2, typeof(UnityEngine.Vector2));
            UnityEngine.Vector2 arg2 = (UnityEngine.Vector2)ToLua.CheckObject(L, 3, typeof(UnityEngine.Vector2));
            float        arg3        = (float)LuaDLL.luaL_checknumber(L, 4);
            float        arg4        = (float)LuaDLL.luaL_checknumber(L, 5);
            InterpType   arg5        = (InterpType)ToLua.CheckObject(L, 6, typeof(InterpType));
            bool         arg6        = LuaDLL.luaL_checkboolean(L, 7);
            RepeatType   arg7        = (RepeatType)ToLua.CheckObject(L, 8, typeof(RepeatType));
            int          arg8        = (int)LuaDLL.luaL_checknumber(L, 9);
            AnimCallBack arg9        = null;
            LuaTypes     funcType10  = LuaDLL.lua_type(L, 10);

            if (funcType10 != LuaTypes.LUA_TFUNCTION)
            {
                arg9 = (AnimCallBack)ToLua.CheckObject(L, 10, typeof(AnimCallBack));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 10);
                arg9 = DelegateFactory.CreateDelegate(typeof(AnimCallBack), func) as AnimCallBack;
            }

            object[] arg10 = ToLua.CheckObjectArray(L, 11);
            AnimData o     = AnimSystem.CustomMethodToVector2(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#5
0
    public static AnimData CustomMethodToVector2(AnimCustomMethodVector2 method, Vector2 from, Vector2 to,
                                                 float time            = 0.5f,
                                                 InterpType interp     = InterpType.Default,
                                                 RepeatType repeatType = RepeatType.Once,
                                                 AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.AnimType, AnimType.Custom_Vector2,
            AnimParamType.FromV2, from,
            AnimParamType.ToV2, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CustomMethodV2, method,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
示例#6
0
        public static TweenScript CustomTweenVector2(AnimCustomMethodVector2 method, Vector2 from, Vector2 to,
                                                     float time             = 0.5f,
                                                     float delayTime        = 0,
                                                     bool IsIgnoreTimeScale = false,
                                                     LoopType repeatType    = LoopType.Once,
                                                     int repeatCount        = -1)
        {
            TweenScript tweenTmp = StackObjectPool <TweenScript> .GetObject();

            tweenTmp.animType       = AnimType.Custom_Vector2;
            tweenTmp.fromV2         = from;
            tweenTmp.toV2           = to;
            tweenTmp.customMethodV2 = method;
            tweenTmp.SetDelay(delayTime);
            tweenTmp.totalTime = time;
            tweenTmp.SetLoopType(repeatType, repeatCount);
            // l_tmp.isIgnoreTimeScale = IsIgnoreTimeScale;
            tweenTmp.Init();
            GetInstance().animList.Add(tweenTmp);
            return(tweenTmp);
        }
示例#7
0
    public static Delegate AnimCustomMethodVector2(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            AnimCustomMethodVector2 fn = delegate(UnityEngine.Vector2 param0) { };
            return(fn);
        }

        if (!flag)
        {
            AnimCustomMethodVector2_Event target = new AnimCustomMethodVector2_Event(func);
            AnimCustomMethodVector2       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            AnimCustomMethodVector2_Event target = new AnimCustomMethodVector2_Event(func, self);
            AnimCustomMethodVector2       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }