public void AnimColorTo(Color color, float time, MadiTween.EaseType easing) { MadiTween.ValueTo(gameObject, MadiTween.Hash( "from", tint, "to", color, "time", time, "onupdate", "OnTintChange", "easetype", easing )); }
public void MoveToLocal(Vector2 position, MadiTween.EaseType easeType, float time) { if (time == 0) { cameraPos = MadMath.ClosestPoint(dragBounds, position); moveAnim = false; } else { moveAnimStartPosition = cachedCamPos; moveAnimEndPosition = position; moveAnimStartTime = Time.time; moveAnimDuration = time; moveAnimEaseType = easeType; moveAnim = true; } }
public void AnimRotateTo(Vector3 rotation, float time, MadiTween.EaseType easing) { MadiTween.RotateTo(gameObject, MadiTween.Hash( "rotation", rotation, "time", time, "easetype", easing, "islocal", true )); }
public void AnimColor(Color from, Color to, float time, MadiTween.EaseType easing) { tint = from; AnimColorTo(to, time, easing); }
public void AnimMoveTo(Vector3 target, float time, MadiTween.EaseType easing) { MadiTween.MoveTo(gameObject, MadiTween.Hash( "position", target, "time", time, "easetype", easing, "islocal", true )); }
public void AnimRotate(Vector3 from, Vector3 to, float time, MadiTween.EaseType easing) { transform.localScale = from; AnimScaleTo(to, time, easing); }
public void AnimMove(Vector3 from, Vector3 to, float time, MadiTween.EaseType easing) { transform.localPosition = from; AnimMoveTo(to, time, easing); }
public void AnimScaleTo(Vector3 scale, float time, MadiTween.EaseType easing) { MadiTween.ScaleTo(gameObject, MadiTween.Hash( "scale", scale, "time", time, "easetype", easing )); }
public void LookAtLevel(string levelName, MadiTween.EaseType easeType, float time) { var icon = GetIcon(levelName); if (icon != null) { LookAtIcon(icon, easeType, time); } else { Debug.LogError("No icon found for level '" + levelName + "'"); } }
// =========================================================== // Methods // =========================================================== #region Public API public void LookAtIcon(MadLevelIcon icon, MadiTween.EaseType easeType, float time) { draggable.MoveToLocal(icon.transform.localPosition, easeType, time); }
protected Vector3 Ease(MadiTween.EaseType type, Vector3 start, Vector3 end, float percentage) { var fun = MadiTween.GetEasingFunction(type); float x = fun(start.x, end.x, percentage); float y = fun(start.y, end.y, percentage); float z = fun(start.z, end.z, percentage); return new Vector3(x, y, z); }