protected override void CloseScope() { if (node != null) { node.UpdateNodeRect(); node.ResetErrorStatus(); } if (saveOnScopeEnd) { NodeGUIUtility.NodeEventHandler(new NodeEvent(NodeEvent.EventType.EVENT_SAVE)); } }
private void UpdateNodeName(NodeGUI node) { var newName = EditorGUILayout.TextField("Node Name", node.name); if (NodeGUIUtility.allNodeNames != null) { var overlapping = NodeGUIUtility.allNodeNames.GroupBy(x => x) .Where(group => group.Count() > 1) .Select(group => group.Key); if (overlapping.Any() && overlapping.Contains(newName)) { EditorGUILayout.HelpBox("This node name already exist. Please put other name:" + newName, MessageType.Error); AssetBundleGraphEditorWindow.AddNodeException(new NodeException("Node name " + newName + " already exist.", node.nodeId)); } } if (newName != node.name) { node.BeforeSave(); node.name = newName; node.UpdateNodeRect(); node.Save(); } }