Guest User

Untitled

a guest
Aug 30th, 2015
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Paths : Array;
  2. var RayColor : Color = Color.white;
  3.  
  4. function OnDrawGizmosSelected(){
  5.     Gizmos.color = RayColor;
  6.    
  7.     var Path_Objs : Array = transform.GetComponentsInChildren(Transform);
  8.     Paths = new Array();
  9.    
  10.     for(var Path_Obj : Transform in Path_Objs){
  11.         if (Path_Obj != transform){
  12.             Paths [Paths.length] = Path_Obj;
  13.         }
  14.     }
  15.    
  16.     for(var i : int = 0; i < Paths.length; i ++){
  17.         var Pos : Vector3 = Paths[i].position;
  18.         if (i > 0){
  19.             var Prev = Paths[i - 1].position;
  20.             Gizmos.DrawLine(Prev, Pos);
  21.             Gizmos.DrawWireSphere(Pos, 0.5);
  22.         }
  23.     }
  24. }
RAW Paste Data