Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Path: MonoBehaviour
  5. {
  6. public bool isDebug = true;
  7. public float Radius = 2.0f;
  8. public Vector3[] pointA;
  9.  
  10. public float Length
  11. {
  12. get
  13. {
  14. return pointA.Length;
  15. }
  16. }
  17.  
  18. public Vector3 GetPoint(int index)
  19. {
  20. return pointA[index];
  21. }
  22.  
  23. /// <summary>
  24. /// Show Debug Grids and obstacles inside the editor
  25. /// </summary>
  26. void OnDrawGizmos()
  27. {
  28. if (!isDebug)
  29. return;
  30.  
  31. for (int i = 0; i < pointA.Length; i++)
  32. {
  33. if (i + 1 < pointA.Length)
  34. {
  35. Debug.DrawLine(pointA[i], pointA[i + 1], Color.red);
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement