Exemple #1
0
 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
         ));
 }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
 public void AnimRotateTo(Vector3 rotation, float time, MadiTween.EaseType easing) {
     MadiTween.RotateTo(gameObject, MadiTween.Hash(
         "rotation", rotation,
         "time", time,
         "easetype", easing,
         "islocal", true
     ));
 }
Exemple #4
0
 public void AnimColor(Color from, Color to, float time, MadiTween.EaseType easing) {
     tint = from;
     AnimColorTo(to, time, easing);
 }
Exemple #5
0
 public void AnimMoveTo(Vector3 target, float time, MadiTween.EaseType easing) {
     MadiTween.MoveTo(gameObject, MadiTween.Hash(
         "position", target,
         "time", time,
         "easetype", easing,
         "islocal", true
     ));
 }
Exemple #6
0
 public void AnimRotate(Vector3 from, Vector3 to, float time, MadiTween.EaseType easing) {
     transform.localScale = from;
     AnimScaleTo(to, time, easing);
 }
Exemple #7
0
 public void AnimMove(Vector3 from, Vector3 to, float time, MadiTween.EaseType easing) {
     transform.localPosition = from;
     AnimMoveTo(to, time, easing);
 }
Exemple #8
0
 public void AnimScaleTo(Vector3 scale, float time, MadiTween.EaseType easing) {
     MadiTween.ScaleTo(gameObject, MadiTween.Hash(
         "scale", scale,
         "time", time,
         "easetype", easing
     ));
 }
Exemple #9
0
 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 + "'");
     }
 }
Exemple #10
0
 // ===========================================================
 // Methods
 // ===========================================================
 
 #region Public API
 
 public void LookAtIcon(MadLevelIcon icon, MadiTween.EaseType easeType, float time) {
     draggable.MoveToLocal(icon.transform.localPosition, easeType, time);
 }
Exemple #11
0
 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);
 }