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