public void ScaleTo(Vector3 from, Vector3 to, float time, SA_EaseType easeType = SA_EaseType.linear) { transform.localScale = from; FinalVectorValue = to; SA_iTween.ScaleTo(gameObject, SA_iTween.Hash("scale", to, "time", time, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }
public void RotateTo(Vector3 from, Vector3 to, float time, SA_EaseType easeType = SA_EaseType.linear) { transform.rotation = Quaternion.Euler(from); FinalVectorValue = to; SA_iTween.RotateTo(gameObject, SA_iTween.Hash("rotation", to, "time", time, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }
public void VectorTo(Vector3 from, Vector3 to, float time, SA_EaseType easeType = SA_EaseType.linear) { transform.position = from; FinalVectorValue = to; iTween.MoveTo(gameObject, iTween.Hash("position", to, "time", time, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }
public void ValueTo(float from, float to, float time, SA_EaseType easeType = SA_EaseType.linear) { Vector3 pos = transform.position; pos.x = from; transform.position = pos; FinalFloatValue = to; iTween.MoveTo(gameObject, iTween.Hash("x", to, "time", time, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }
//-------------------------------------- // Public Methods //-------------------------------------- public void ValueTo(float from, float to, float time, SA_EaseType easeType = SA_EaseType.linear) { Vector3 pos = transform.position; pos.x = from; transform.position = pos; FinalFloatValue = to; SA_iTween.MoveTo(gameObject, SA_iTween.Hash("x", to, "time", time, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }
public static void MoveTo(this RectTransform transform, object callbackTarget, Vector2 position, float time, SA_EaseType easeType = SA_EaseType.linear, System.Action OnCompleteAction = null) { var tw = SA_ValuesTween.Create(); tw.VectorTo(transform.anchoredPosition, position, time, easeType); tw.DestoryGameObjectOnComplete = true; tw.OnVectorValueChanged.AddSafeListener(transform, (Vector3 pos) => { transform.anchoredPosition = pos; }); tw.OnComplete.AddSafeListener(callbackTarget, OnCompleteAction); }
public static void ScaleGameObjectTo(GameObject go, object callbackTarget, Vector3 scale, float time, SA_EaseType easeType, Action OnCompleteAction) { SA_ValuesTween tw = go.AddComponent <SA_ValuesTween>(); tw.DestoryGameObjectOnComplete = false; tw.ScaleTo(go.transform.localScale, scale, time, easeType); tw.OnComplete.AddSafeListener(callbackTarget, OnCompleteAction); }
public static void ScaleTo(this GameObject go, object callbackTarget, Vector3 scale, float time, SA_EaseType easeType, Action OnCompleteAction) { ScaleGameObjectTo(go, callbackTarget, scale, time, easeType, OnCompleteAction); }
public static void ScaleTo(this GameObject go, Vector3 scale, float time, SA_EaseType easeType = SA_EaseType.linear) { ScaleGameObjectTo(go, go, scale, time, easeType, null); }
public static void MoveTo(this GameObject go, object callbackTarget, Vector3 position, float time, SA_EaseType easeType, Action OnCompleteAction) { MoveGameObjectTo(go, callbackTarget, position, time, easeType, OnCompleteAction); }
public static void MoveTo(this GameObject go, Vector3 position, float time, SA_EaseType easeType = SA_EaseType.linear) { MoveGameObjectTo(go, go, position, time, easeType, null); }
public static void RotateGameObjectTo(this GameObject go, object callbackTarget, Vector3 eulerRotation, float time, SA_EaseType easeType, Action OnCompleteAction) { SA_ValuesTween tw = go.AddComponent <SA_ValuesTween>(); tw.DestoryGameObjectOnComplete = false; tw.RotateTo(go.transform.rotation.eulerAngles, eulerRotation, time, easeType); tw.OnComplete.AddSafeListener(callbackTarget, OnCompleteAction); }
public static void RotateTo(this GameObject go, object callbackTarget, Vector3 eulerRotation, float time, SA_EaseType easeType, Action OnCompleteAction) { RotateGameObjectTo(go, callbackTarget, eulerRotation, time, easeType, OnCompleteAction); }
//-------------------------------------- // Animation //-------------------------------------- public static void RotateTo(this GameObject go, Vector3 eulerRotation, float time, SA_EaseType easeType = SA_EaseType.linear) { RotateGameObjectTo(go, go, eulerRotation, time, easeType, null); }
private void Animate(float from, float to, SA_EaseType easeType) { _CurrentTween = SA_ValuesTween.Create(); _CurrentTween.OnValueChanged += HandleOnValueChanged; _CurrentTween.ValueTo(from, to, 0.5f, easeType); }
public void VectorToS(Vector3 from, Vector3 to, float speed, SA_EaseType easeType = SA_EaseType.linear) { transform.position = from; FinalVectorValue = to; SA_iTween.MoveTo(gameObject, SA_iTween.Hash("position", to, "speed", speed, "easeType", easeType.ToString(), "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); }