void OnEnable() { _path = (ZPath)target; _style.fontStyle = FontStyle.Bold; _style.normal.textColor = Color.white; if (!_path.isInitialized) { _path.isInitialized = true; _path.pathName = "New Path " + ++count; _path.initialName = _path.pathName; } }
public static void ShowGUIInSecen(ZPath path, GUIStyle style) { if (path == null) { return; } if (!path.gameObject.activeInHierarchy) { return; } Handles.Label(path.nodes[0], "'" + path.pathName + "' Begin", style); Handles.Label(path.nodes[path.nodes.Count - 1], "'" + path.pathName + "' End", style); for (int i = 0; i < path.nodes.Count; i++) { path.nodes[i] = Handles.PositionHandle(path.nodes[i], Quaternion.identity); if (i != 0 && i != path.nodes.Count - 1) { Handles.Label(path.nodes[i], "node " + i.ToString(), style); } } }