示例#1
0
 void Update()
 {
     if (lastPosition != transform.position && transform.parent)
     {
         AIWaypoints waypoints = transform.parent.GetComponent <AIWaypoints>();
         if (waypoints)
         {
             waypoints.events.DispatchEvent(new Event("AIDestinationMoved").SetData(this));
             lastPosition = transform.position;
         }
     }
 }
示例#2
0
        void OnDrawGizmosSelected()
        {
            if (!transform.parent || !gameObject.activeSelf)
            {
                return;
            }
            AIWaypoints waypoints = transform.parent.GetComponent <AIWaypoints>();

            if (!waypoints)
            {
                return;
            }
            int index = transform.GetSiblingIndex() + 1;
            var gui   = new GUIStyle();

            gui.fontSize  = 16;
            gui.fontStyle = FontStyle.Bold;
            Handles.Label(transform.position, index.ToString(), gui);
        }