WaypointCam.cs 640 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using System.Collections;
  3. public class WaypointCam : MonoBehaviour {
  4. public Color WaypointsColor = new Color(1,0,0,1);
  5. public bool draw = true;
  6. static public Transform[] waypoints;
  7. void Awake(){
  8. waypoints = gameObject.GetComponentsInChildren<Transform>();
  9. }
  10. void OnDrawGizmos () {
  11. if (draw == true){
  12. waypoints = gameObject.GetComponentsInChildren<Transform>();
  13. foreach (Transform waypoint in waypoints){
  14. Gizmos.color = WaypointsColor;
  15. Gizmos.DrawSphere( waypoint.position, 1.0f );
  16. Gizmos.color = WaypointsColor;
  17. Gizmos.DrawWireSphere ( waypoint.position, 6.0f );
  18. }
  19. }
  20. }
  21. }