Browse Source

added anim curve

master
Sagittaeri 7 years ago
parent
commit
466fe42c5c
2 changed files with 2 additions and 1 deletions
  1. +2
    -1
      IronToad_UnityProject/Assets/Lighthouse.cs
  2. BIN
      IronToad_UnityProject/Assets/_Scenes/LighthouseTestScene.unity

+ 2
- 1
IronToad_UnityProject/Assets/Lighthouse.cs View File

@ -12,6 +12,7 @@ public class Lighthouse : MonoBehaviour
public float speed = 200f;
public float timePadding = 0.5f;
public float timeBetweenPoints = 3f;
public AnimationCurve animationCurve;
private BGCcCursor splineCursor;
private int targetPoint = 0;
@ -63,7 +64,7 @@ public class Lighthouse : MonoBehaviour
float distance = Mathf.Abs(end - start);
LeanTween.value(gameObject, start, end, distance / speed + timePadding).setOnUpdate((float val)=>{
splineCursor.Distance = val;
}).setEaseInOutQuad().setOnComplete(moveToNextPoint);
}).setEase(animationCurve).setOnComplete(moveToNextPoint);
});
}
}

BIN
IronToad_UnityProject/Assets/_Scenes/LighthouseTestScene.unity View File


Loading…
Cancel
Save