You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
900 B

7 years ago
  1. #pragma strict
  2. import DentedPixel;
  3. public var customAnimationCurve:AnimationCurve;
  4. public var pt1:Transform;
  5. public var pt2:Transform;
  6. public var pt3:Transform;
  7. public var pt4:Transform;
  8. private var containingSphere:Transform;
  9. private var spline:LTSpline;
  10. private var ltLogo:GameObject;
  11. function Start () {
  12. ltLogo = GameObject.Find("LeanTweenLogo");
  13. containingSphere = GameObject.Find("ContaingCube").transform;
  14. var path:Vector3[] = [pt1.position,pt1.position,pt2.position,pt3.position,pt4.position,pt4.position];
  15. spline = new LTSpline( path );
  16. LeanTween.moveSplineLocal( ltLogo, path, 3.0 ).setEase(LeanTweenType.easeInQuad).setOrientToPath(true).setRepeat(-1);
  17. }
  18. function Update(){
  19. containingSphere.transform.eulerAngles.y += Time.deltaTime*3.0;
  20. }
  21. function OnDrawGizmos(){
  22. if(spline!=null)
  23. spline.gizmoDraw(1.0f); // debug aid to be able to see the path in the scene inspector
  24. }