Esempio n. 1
0
        public static ColorAnimationData GetColorAnimData(Color start, Color end, float duration, EaseType easeType,
                                                          RectTransform target, BosAnimationMode mode = BosAnimationMode.Single, System.Action onEnd = null)
        {
            Graphic graphic = target.GetComponent <Graphic>();

            ColorAnimationData data = new ColorAnimationData {
                StartValue = start,
                EndValue   = end,
                Duration   = duration,
                Target     = target.gameObject,
                EaseType   = easeType,
                OnStart    = (c, o) => graphic.color = c,
                OnUpdate   = (c, t, o) => graphic.color = c,
                OnEnd      = (c, o) => {
                    graphic.color = c;
                    onEnd?.Invoke();
                },
                AnimationMode = mode
            };

            return(data);
        }
Esempio n. 2
0
 public static Vector3AnimationData ConstructScaleAnimationData(this RectTransform trs, Vector3 startValue, Vector3 endValue,
                                                                float duration, BosAnimationMode mode, EaseType easeType, System.Action endAction = null)
 {
     return(new Vector3AnimationData {
         StartValue = startValue,
         EndValue = endValue,
         Duration = duration,
         AnimationMode = mode,
         EaseType = easeType,
         Target = trs.gameObject,
         OnStart = trs.UpdateScaleFunctor(),
         OnUpdate = trs.UpdateScaleTimedFunctor(),
         OnEnd = trs.UpdateScaleFunctor(endAction)
     });
 }
Esempio n. 3
0
 public Vector2AnimationData AsAnimationMode(BosAnimationMode mode)
 {
     AnimationMode = mode;
     return(this);
 }