Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get the needed data before the handle
- int controlIDBeforeHandle = GUIUtility.GetControlID(someHashCode, FocusType.Passive);
- bool isEventUsedBeforeHandle = (Event.current.type == EventType.Used);
- // Draw the handle at the position of each node in the waypoint array
- // Get the needed data after the handle
- int controlIDAfterHandle = GUIUtility.GetControlID(someHashCode, FocusType.Passive);
- bool isEventUsedByHandle = !isEventUsedBeforeHandle && (Event.current.type == EventType.Used);
- if
- ((controlIDBeforeHandle < GUIUtility.hotControl &&
- GUIUtility.hotControl < controlIDAfterHandle) ||
- isEventUsedByHandle)
- {
- selectedNodeIndex = n; // This gives me the index of the node that is selected
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement