void ConnectionDetailsGUI(CurvySplineSegment seg) { if (!seg || seg.Connection == null) { return; } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent(mTexSelect, "Select Other"), GUILayout.ExpandWidth(false))) { Selection.activeObject = (seg == Target) ? seg.Connection.Other : seg; } EditorGUILayout.LabelField(seg.Spline.name + "->" + seg.Connection.Other.Spline.name + "." + seg.Connection.Other.name); if (GUILayout.Button(new GUIContent(mTexDelete, "Delete Connection"), GUILayout.ExpandWidth(false))) { Undo.RegisterSceneUndo("Delete Connection"); seg.ConnectTo(null); SceneView.RepaintAll(); return; } EditorGUILayout.EndHorizontal(); seg.Connection.Heading = (CurvyConnection.HeadingMode)EditorGUILayout.EnumPopup(new GUIContent("Heading", "Heading Mode"), seg.Connection.Heading); seg.Connection.Sync = (CurvyConnection.SyncMode)EditorGUILayout.EnumPopup(new GUIContent("Synchronization", "Synchronization Mode"), seg.Connection.Sync); seg.Connection.Tags = EditorGUILayout.TextField(new GUIContent("Tags", "Identifier tags (space separated)"), seg.Connection.Tags); if (GUI.changed) { seg.SyncConnections(); if (seg.Connection.Active) { seg.Connection.Other.Spline.Refresh(); } } GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1)); }
void ConnectionDetailsGUI(CurvySplineSegment seg) { if (!seg || seg.Connection==null) return; EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent(mTexSelect, "Select Other"), GUILayout.ExpandWidth(false))) { Selection.activeObject = (seg == Target) ? seg.Connection.Other : seg; } EditorGUILayout.LabelField(seg.Spline.name + "->" + seg.Connection.Other.Spline.name + "." + seg.Connection.Other.name); if (GUILayout.Button(new GUIContent(mTexDelete, "Delete Connection"), GUILayout.ExpandWidth(false))) { Undo.RegisterSceneUndo("Delete Connection"); seg.ConnectTo(null); SceneView.RepaintAll(); return; } EditorGUILayout.EndHorizontal(); seg.Connection.Heading = (CurvyConnection.HeadingMode)EditorGUILayout.EnumPopup(new GUIContent("Heading", "Heading Mode"), seg.Connection.Heading); seg.Connection.Sync = (CurvyConnection.SyncMode)EditorGUILayout.EnumPopup(new GUIContent("Synchronization", "Synchronization Mode"), seg.Connection.Sync); seg.Connection.Tags = EditorGUILayout.TextField(new GUIContent("Tags", "Identifier tags (space separated)"), seg.Connection.Tags); if (GUI.changed) { seg.SyncConnections(); if (seg.Connection.Active) seg.Connection.Other.Spline.Refresh(); } GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1)); }