Initial Commit (broken due to version update)
This commit is contained in:
parent
74003df84b
commit
3f7b3b7440
3132 changed files with 1103305 additions and 0 deletions
30
Assets/LeanTween/Examples/Scripts/PathBezier2d.cs
Normal file
30
Assets/LeanTween/Examples/Scripts/PathBezier2d.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PathBezier2d : MonoBehaviour {
|
||||
|
||||
public Transform[] cubes;
|
||||
|
||||
public GameObject dude1;
|
||||
public GameObject dude2;
|
||||
|
||||
private LTBezierPath visualizePath;
|
||||
|
||||
void Start () {
|
||||
// move
|
||||
Vector3[] path = new Vector3[]{cubes[0].position,cubes[1].position,cubes[2].position,cubes[3].position};
|
||||
visualizePath = new LTBezierPath(path);
|
||||
LeanTween.move(dude1, path, 10f).setOrientToPath2d(true);
|
||||
|
||||
// move local
|
||||
LeanTween.moveLocal(dude2, path, 10f).setOrientToPath2d(true);
|
||||
}
|
||||
|
||||
void OnDrawGizmos(){
|
||||
// Debug.Log("drwaing");
|
||||
Gizmos.color = Color.red;
|
||||
if(visualizePath!=null)
|
||||
visualizePath.gizmoDraw(); // To Visualize the path, use this method
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue