예제 #1
0
        public SHR_Waypoint GetNearestWaypoint(Vector3 pos)
        {
            SHR_Waypoint closest   = null;
            float        closeDist = 100000f;

            foreach (var wp in GetComponentsInChildren <SHR_Waypoint>())
            {
                float dist = Vector3.Distance(pos, wp.transform.position);
                if (dist < closeDist)
                {
                    closeDist = dist;
                    closest   = wp;
                }
            }

            return(closest);
        }
예제 #2
0
 public WPConnection(SHR_Waypoint wp, Type type)
 {
     this.wp   = wp;
     this.type = type;
 }