private void DrawNodes(bool highlightHovered = false) // отображает узлы, отвечает за их перемещение { EditorGUI.BeginChangeCheck(); for (int i = 0; i < polyLine.NodesCount; i++) { if (highlightHovered && i == selectedNodeIndex) { Handles.color = Color.yellow; } else { Handles.color = Color.white; } Handles.CapFunction cap; if (i == polyLine.NodesCount - 1) { cap = Handles.SphereHandleCap; } else { cap = Handles.SphereHandleCap; } Quaternion rotation = Quaternion.identity; Vector2 nodePosition = polyLine.GetNode(i); Vector3 newPosition = Handles.FreeMoveHandle(nodePosition, rotation, 0.5f, Vector3.zero, cap); if (newPosition != (Vector3)nodePosition) { polyLine.MoveNode(i, newPosition); } } if (EditorGUI.EndChangeCheck()) { //Debug.Log("EndChange"); Undo.RecordObject(path, "Change node position"); UpdatePath(); } }