//-------------------------------------- // GameObject //-------------------------------------- public static void MoveTo(this GameObject go, Vector3 position, float time, SA.Common.Animation.EaseType easeType = SA.Common.Animation.EaseType.linear, System.Action OnCompleteAction = null) { SA.Common.Animation.ValuesTween tw = go.AddComponent <SA.Common.Animation.ValuesTween>(); tw.DestoryGameObjectOnComplete = false; tw.VectorTo(go.transform.position, position, time, easeType); tw.OnComplete += OnCompleteAction; }
private void Animate(float from, float to, SA.Common.Animation.EaseType easeType) { _CurrentTween = SA.Common.Animation.ValuesTween.Create(); _CurrentTween.OnValueChanged += HandleOnValueChanged; _CurrentTween.ValueTo(from, to, 0.5f, easeType); }
void HandleOnOutTweenComplete() { _CurrentTween = null; }
void HandleOnInTweenComplete() { _CurrentTween = null; Invoke("NotificationDelayComplete", 2f); }
//-------------------------------------- // Handlers //-------------------------------------- private void HandleOnInTweenComplete() { _CurrentTween = null; }