Пример #1
0
    public static AnimData CustomMethodToVector3(AnimCustomMethodVector3 method, Vector3 from, Vector3 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_Vector3,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CustomMethodV3, method,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
Пример #2
0
    public static AnimData CustomMethodToVector3(AnimCustomMethodVector3 method, Vector3 from, Vector3 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_Vector3;
        l_tmp.m_fromV3         = from;
        l_tmp.m_toV3           = to;
        l_tmp.m_customMethodV3 = 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;
 }
Пример #4
0
    static int CustomMethodToVector3(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 11);
            AnimCustomMethodVector3 arg0 = null;
            LuaTypes funcType1           = LuaDLL.lua_type(L, 1);

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

            UnityEngine.Vector3 arg1 = (UnityEngine.Vector3)ToLua.CheckObject(L, 2, typeof(UnityEngine.Vector3));
            UnityEngine.Vector3 arg2 = (UnityEngine.Vector3)ToLua.CheckObject(L, 3, typeof(UnityEngine.Vector3));
            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.CustomMethodToVector3(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 CustomMethodToVector3(AnimCustomMethodVector3 method, Vector3 from, Vector3 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_Vector3,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CustomMethodV3, method,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
Пример #6
0
        public static TweenScript CustomTweenVector3(AnimCustomMethodVector3 method, Vector3 from, Vector3 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_Vector3;
            tweenTmp.fromV3         = from;
            tweenTmp.toV2           = to;
            tweenTmp.customMethodV3 = 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 AnimCustomMethodVector3(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            AnimCustomMethodVector3 fn = delegate(UnityEngine.Vector3 param0) { };
            return(fn);
        }

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