예제 #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 Scale(GameObject animObject, Vector3?from, Vector3 to,
                                 float time             = 0.5f,
                                 InterpType interp      = InterpType.Default,
                                 bool IsIgnoreTimeScale = false,
                                 RepeatType repeatType  = RepeatType.Once,
                                 int repeatCount        = -1,
                                 float delayTime        = 0,
                                 AnimCallBack callBack  = null, object[] parameter = null)
    {
        Vector3 fromTmp = from ?? animObject.transform.localScale;

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.LocalScale,
            AnimParamType.FromV3, fromTmp,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #3
0
    //传From,传准确控制点随机范围
    public static AnimData BezierMove(GameObject animObject, Vector3 from, Vector3 to, float time, RepeatType repeatType,
                                      InterpType interp              = InterpType.Default,
                                      bool isLocal                   = true,
                                      PathType bezierMoveType        = PathType.Bezier2,
                                      float[] t_Bezier_contralRadius = null,
                                      AnimCallBack callBack          = null, object[] parameter = null)
    {
        AnimType animType;

        if (isLocal)
        {
            animType = AnimType.LocalPosition;
        }
        else
        {
            animType = AnimType.Position;
        }

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, animType,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.IsLocal, isLocal,
            AnimParamType.PathType, bezierMoveType,
            AnimParamType.floatControl, t_Bezier_contralRadius,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #4
0
    public static AnimData Blink(GameObject animObject, float space,

                                 float time             = 0.5f,
                                 float delayTime        = 0,
                                 bool IsIgnoreTimeScale = false,
                                 RepeatType repeatType  = RepeatType.Once,
                                 int repeatCount        = -1,
                                 AnimCallBack callBack  = null,
                                 object[] parameter     = null)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.Blink,
            AnimParamType.Space, space,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #5
0
    public static void Rotate(GameObject animObject, Vector3 from, Vector3 to, float time,
                              InterpType interp     = InterpType.Default,
                              RepeatType repeatType = RepeatType.Once,
                              bool isLocal          = true,
                              AnimCallBack callBack = null, params object[] parameter)
    {
        AnimType animType;

        if (isLocal)
        {
            animType = AnimType.LocalRotate;
        }
        else
        {
            animType = AnimType.Rotate;
        }

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, animType,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.IsLocal, isLocal,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        ValueTo(animParnHash);
    }
예제 #6
0
    public static AnimData AlphaTo(GameObject animObject, float from, float to,

                                   float time             = 0.5f,
                                   float delayTime        = 0,
                                   InterpType interp      = InterpType.Default,
                                   bool IsIgnoreTimeScale = false,
                                   RepeatType repeatType  = RepeatType.Once,
                                   int repeatCount        = -1,
                                   bool isChild           = true,
                                   AnimCallBack callBack  = null, object[] parameter = null)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.Alpha,
            AnimParamType.FromFloat, from,
            AnimParamType.ToFloat, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.IsIncludeChild, isChild,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #7
0
    public static AnimData UguiSizeDelta(GameObject animObject, 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)
    {
        Vector2 fromTmp = from ?? animObject.GetComponent <RectTransform>().sizeDelta;

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.UGUI_SizeDetal,
            AnimParamType.FromV2, fromTmp,
            AnimParamType.ToV2, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #8
0
    public static AnimData ValueTo(AnimParamHash l_animHash)
    {
        AnimData l_tmp = l_animHash.GetAnimData();

        l_tmp.Init();

        GetInstance().animList.Add(l_tmp);

        return(l_tmp);
    }
예제 #9
0
    public static AnimData UguiMove(GameObject animObject, Vector3 from, Vector3 to, float time,
                                    InterpType interp = InterpType.Default, AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.UGUI_AnchoredPosition,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #10
0
    public static AnimData Blink(GameObject animObject, float space,
                                 float time            = 0.5f,
                                 RepeatType repeatType = RepeatType.Once,
                                 AnimCallBack callBack = null,
                                 params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.Blink,
            AnimParamType.Space, space,
            AnimParamType.Time, time,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #11
0
    public static void Rotate(GameObject animObject, Vector3?from, Vector3 to,

                              float time             = 0.5f,
                              float delayTime        = 0,
                              bool isLocal           = true,
                              InterpType interp      = InterpType.Default,
                              bool IsIgnoreTimeScale = false,
                              RepeatType repeatType  = RepeatType.Once,
                              int repeatCount        = -1,

                              AnimCallBack callBack = null, object[] parameter = null)
    {
        AnimType animType;
        Vector3  fromTmp;

        if (isLocal)
        {
            fromTmp  = from ?? animObject.transform.localEulerAngles;
            animType = AnimType.LocalRotate;
        }
        else
        {
            fromTmp  = from ?? animObject.transform.eulerAngles;
            animType = AnimType.Rotate;
        }

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, animType,
            AnimParamType.FromV3, fromTmp,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.InteType, interp,
            AnimParamType.IsLocal, isLocal,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        ValueTo(animParnHash);
    }
예제 #12
0
    public static AnimData UguiSizeDelta(GameObject animObject, Vector2 from, Vector2 to,
                                         float time            = 0.5f,
                                         RepeatType repeatType = RepeatType.Once,
                                         InterpType interp     = InterpType.Default,
                                         AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.UGUI_SizeDetal,
            AnimParamType.FromV2, from,
            AnimParamType.ToV2, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #13
0
    public static AnimData Scale(GameObject animObject, Vector3 from, Vector3 to,
                                 float time            = 0.5f,
                                 RepeatType repeatType = RepeatType.Once,
                                 InterpType interp     = InterpType.Default,
                                 AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.LocalScale,
            AnimParamType.FromV3, from,
            AnimParamType.ToV3, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #14
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));
    }
예제 #15
0
    public static AnimData UguiColor(GameObject animObject, Color from, Color to,
                                     float time            = 0.5f,
                                     RepeatType repeatType = RepeatType.Once,
                                     InterpType interp     = InterpType.Default,
                                     bool isChild          = true,
                                     AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.UGUI_Color,
            AnimParamType.FromColor, from,
            AnimParamType.ToColor, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.IsIncludeChild, isChild,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #16
0
    public static AnimData AlphaTo(GameObject animObject, float from, float to, float time,
                                   InterpType interp     = InterpType.Default,
                                   RepeatType repeatType = RepeatType.Once,
                                   bool isChild          = true,
                                   AnimCallBack callBack = null, params object[] parameter)
    {
        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.Alpha,
            AnimParamType.FromFloat, from,
            AnimParamType.ToFloat, to,
            AnimParamType.Time, time,
            AnimParamType.InteType, interp,
            AnimParamType.IsIncludeChild, isChild,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }
예제 #17
0
    /// <summary>
    /// 动画过度到目标alpha
    /// </summary>
    /// <param name="animObject">动画对象</param>
    /// <param name="from">起始alpha(可空)</param>
    /// <param name="to">目标alpha</param>
    /// <param name="time">动画时间</param>
    /// <param name="isChild">是否影响子节点</param>
    /// <param name="interp">插值类型</param>
    /// <param name="IsIgnoreTimeScale">是否忽略时间缩放</param>
    /// <param name="repeatType">重复类型</param>
    /// <param name="repeatCount">重复次数</param>
    /// <param name="callBack">动画完成回调函数</param>
    /// <param name="parameter">动画完成回调函数传参</param>
    /// <returns></returns>
    public static AnimData UguiAlpha(GameObject animObject, float?from, float to,
                                     float time             = 0.5f,
                                     float delayTime        = 0,
                                     InterpType interp      = InterpType.Default,
                                     bool isChild           = true,
                                     bool IsIgnoreTimeScale = false,
                                     RepeatType repeatType  = RepeatType.Once,
                                     int repeatCount        = -1,
                                     AnimCallBack callBack  = null, object[] parameter = null)
    {
        float fromTmp = from ?? 1;

        if (from == null)
        {
            if (animObject.GetComponent <Graphic>() != null)
            {
                fromTmp = from ?? animObject.GetComponent <Graphic>().color.a;
            }
        }

        AnimParamHash animParnHash = new AnimParamHash(
            AnimParamType.GameObj, animObject,
            AnimParamType.AnimType, AnimType.UGUI_Alpha,
            AnimParamType.FromFloat, fromTmp,
            AnimParamType.ToFloat, to,
            AnimParamType.Time, time,
            AnimParamType.DelayTime, delayTime,
            AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale,
            AnimParamType.RepeatCount, repeatCount,
            AnimParamType.InteType, interp,
            AnimParamType.IsIncludeChild, isChild,
            AnimParamType.RepeatType, repeatType,
            AnimParamType.CallBack, callBack,
            AnimParamType.CallBackParams, parameter
            );

        return(ValueTo(animParnHash));
    }