Beispiel #1
0
 public static ATweener <float, float> DoScaleX(this Transform transform, float endValue, float duration)
 {
     return(ATween.To(() => transform.localScale.x, v =>
     {
         var scale = transform.localScale;
         scale.x = v;
         transform.localScale = scale;
     }, endValue, duration));
 }
Beispiel #2
0
 public static ATweener <float, float> DoLocalMoveZ(this Transform transform, float endValue, float duration)
 {
     return(ATween.To(() => transform.localPosition.z, v =>
     {
         var pos = transform.localPosition;
         pos.z = v;
         transform.localPosition = pos;
     }, endValue, duration));
 }
Beispiel #3
0
 public static ATweener <float, float> DoFade(this Graphic graphic, float endValue, float duration)
 {
     return(ATween.To(() => graphic.color.a, v =>
     {
         var c = graphic.color;
         c.a = v;
         graphic.color = c;
     }, endValue, duration));
 }
Beispiel #4
0
 public static ATweener <float, float> DoMoveY(this Transform transform, float endValue, float duration)
 {
     return(ATween.To(() => transform.position.y, v =>
     {
         var pos = transform.position;
         pos.y = v;
         transform.position = pos;
     }, endValue, duration));
 }
Beispiel #5
0
 public static ATweener <float, float> DoSizeDeltaY(this RectTransform rectTransform, float endValue, float duration)
 {
     return(ATween.To(() => rectTransform.sizeDelta.y, v =>
     {
         var size = rectTransform.sizeDelta;
         size.y = v;
         rectTransform.sizeDelta = size;
     }, endValue, duration));
 }
Beispiel #6
0
 public static ATweener <float, float> DoAnchorPosY(this RectTransform rectTransform, float endValue, float duration)
 {
     return(ATween.To(() => rectTransform.anchoredPosition.y, v =>
     {
         var vec = rectTransform.anchoredPosition;
         vec.y = v;
         rectTransform.anchoredPosition = vec;
     }, endValue, duration));
 }
Beispiel #7
0
        public static void Initialize()
        {
            if (initialized)
            {
                return;
            }

            instance = new GameObject("[ATween]").AddComponent <ATween>();

            initialized = true;
        }
Beispiel #8
0
        public ATweener(T1 begin, T1 end, float duration, Func <T2> getter, Action <T2> setter, ITweenPlugin <T1, T2> plugin)
        {
            ATween.Initialize();

            this.begin           = begin;
            this.end             = end;
            this.duration        = duration;
            this.getter          = getter;
            this.setter          = setter;
            this.ease            = ATween.DefaultEase;
            this.plugin          = plugin;
            this.ignoreTimeScale = ATween.IgnoreTimeScale;
        }
Beispiel #9
0
 public static ATweener <Vector3, Vector3> DoScale(this Transform transform, float endValue, float duration)
 {
     return(ATween.To(() => transform.localScale, v => transform.localScale = v, new Vector3(endValue, endValue, endValue), duration));
 }
Beispiel #10
0
 public static ATweener <Vector3, Quaternion> DoLocalRotate(this Transform transform, Vector3 endValue, float duration)
 {
     return(ATween.To(() => transform.localRotation, v => transform.localRotation = v, endValue, duration));
 }
Beispiel #11
0
 public static ATweener <Vector3, Vector3> DoMove(this Transform transform, Vector3 endValue, float duration)
 {
     return(ATween.To(() => transform.position, v => transform.position = v, endValue, duration));
 }
Beispiel #12
0
 public static ATweener <Color, Color> DoColor(this Graphic graphic, Color endValue, float duration)
 {
     return(ATween.To(() => graphic.color, v => graphic.color = v, endValue, duration));
 }
Beispiel #13
0
 public static ATweener <Vector2, Vector2> DoSizeDelta(this RectTransform rectTransform, Vector2 endValue, float duration)
 {
     return(ATween.To(() => rectTransform.sizeDelta, v => rectTransform.sizeDelta = v, endValue, duration));
 }
Beispiel #14
0
 public static ATweener <Vector2, Vector2> DoAnchorPos(this RectTransform rectTransform, Vector2 endValue, float duration)
 {
     return(ATween.To(() => rectTransform.anchoredPosition, v => rectTransform.anchoredPosition = v, endValue, duration));
 }