public void MoveAnchors(Vector2 anchorMin, Vector2 anchorMax, UIAnimationDirection animationDirection = UIAnimationDirection.From, Action callback = null, UIAnimationOptions animationOptions = null) { var anchors = new Vector4(anchorMin.x, anchorMin.y, anchorMax.x, anchorMax.y); AnchorsTweener.Tween(anchors, animationDirection, callback, animationOptions); }
public void Tween(TProperty value, UIAnimationDirection animationDirection = UIAnimationDirection.From, Action callback = null, UIAnimationOptions animationOptions = null) { if (animationOptions == null) { animationOptions = new UIAnimationOptions(); } if (tweenerCoroutine != null && tweenerCoroutine.Running) { StopTween(); tweenerCoroutine.OnFinished += b => { Tween(value, animationDirection, callback, animationOptions); }; return; } if (animationDirection == UIAnimationDirection.RelativeTo || animationDirection == UIAnimationDirection.RelativeFrom) { value = AddValues(value, TargetValue); } if (animationDirection == UIAnimationDirection.To || animationDirection == UIAnimationDirection.RelativeTo) { TargetValue = value; } else { TargetValue = CurrentValue; CurrentValue = value; } if (animationOptions.SavePosition) { SavedValue = TargetValue; } if (animationOptions.Instant) { CurrentValue = TargetValue; return; } Tweening = true; tweenerCoroutine = _owner.CreateCoroutine(TweenCoroutine(animationOptions.Ease, animationOptions.Duration, animationOptions.Delay)); tweenerCoroutine.OnFinished += stopped => { if (!stopped) { CurrentValue = TargetValue; } Tweening = false; callback?.Invoke(); }; }
public void Fade(float fade, UIAnimationDirection animationDirection = UIAnimationDirection.To, Action callback = null, UIAnimationOptions animationOptions = null) { AlphaTweener.Tween(fade, animationDirection, callback, animationOptions); }
public void Scale(Vector3 scale, UIAnimationDirection animationDirection = UIAnimationDirection.From, Action callback = null, UIAnimationOptions animationOptions = null) { ScaleTweener.Tween(scale, animationDirection, callback, animationOptions); }
public void Resize(Vector2 size, UIAnimationDirection animationDirection = UIAnimationDirection.RelativeTo, Action callback = null, UIAnimationOptions animationOptions = null) { SizeTweener.Tween(size, animationDirection, callback, animationOptions); }
public void Rotate(Vector3 rotation, UIAnimationDirection animationDirection = UIAnimationDirection.From, Action callback = null, UIAnimationOptions animationOptions = null) { RotationTweener.Tween(rotation, animationDirection, callback, animationOptions); }
public void Move(Vector3 position, UIAnimationDirection animationDirection = UIAnimationDirection.To, Action callback = null, UIAnimationOptions animationOptions = null) { PositionTweener.Tween(position, animationDirection, callback, animationOptions); }