Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var waypoints = new Array();
- var myWaypoints:Transform;
- function Start(){
- // for each of the child objects of the waypoints object
- for (var child : Transform in myWaypoints) {
- // add them to the waypoints array
- waypoints.Add(child);
- }
- }
- function OnDrawGizmos () {
- Gizmos.color = Color.red;
- for(var i : int = 0; i< waypoints.length;i++)
- {
- var pos : Vector3 = waypoints[i].position;
- // (icon image MUST be placed in Editor folder)
- Gizmos.DrawIcon (waypoints[i].transform.position, "icon.tif");
- if(i>0){
- var prev : Vector3 = waypoints[i-1].position;
- Gizmos.DrawLine(prev,pos);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement