diff --git a/Editor/Scripts/GraphEditor/GraphSystemGroupEditorWindow.cs b/Editor/Scripts/GraphEditor/GraphSystemGroupEditorWindow.cs index 4a99aa2..f9f6eba 100644 --- a/Editor/Scripts/GraphEditor/GraphSystemGroupEditorWindow.cs +++ b/Editor/Scripts/GraphEditor/GraphSystemGroupEditorWindow.cs @@ -36,7 +36,9 @@ private void CreateGUI() { return _addNodeChoices .Select(path => new GraphSystemGroupGraphView.AddNodeAction(path, dropdownMenuAction => { SystemTypeReference systemReference = AssetDatabase.LoadAssetAtPath(path); - _graphView.AddSystemNode(systemReference.GetInstanceID(), dropdownMenuAction.eventInfo.localMousePosition); + _graphView.AddSystemNode( + systemReference.GetInstanceID(), + dropdownMenuAction.eventInfo.localMousePosition); PopulateNodeCreationChoices(); })) .ToArray(); @@ -68,23 +70,11 @@ private void CreateGUI() { _toolbar = new(); - PopulateNodeCreationChoices(); - DropdownField nodeCreateDropDown = new("Create Node", _addNodeChoices, -1); - nodeCreateDropDown.RegisterValueChangedCallback(evt => { - if (string.IsNullOrEmpty(evt.newValue)) { - return; - } - - SystemTypeReference systemReference = AssetDatabase.LoadAssetAtPath(evt.newValue); - _graphView.AddSystemNode(systemReference.GetInstanceID()); - nodeCreateDropDown.index = -1; - PopulateNodeCreationChoices(); - }); - _toolbar.Add(nodeCreateDropDown); - _loadedLabel = new Label(""); _toolbar.Add(_loadedLabel); + _toolbar.Add(new ToolbarSpacer { flex = true}); + Button saveButton = new(Save) { text = "Save" }; @@ -142,8 +132,7 @@ private void PopulateNodeCreationChoices() { existingInstanceIdsNative.Dispose(); HashSet existingNodeGuids = new(); - for (int i = 0; i < existingNodeGuidsNative.Length; i++) { - GUID existingGuid = existingNodeGuidsNative[i]; + foreach (GUID existingGuid in existingNodeGuidsNative) { existingNodeGuids.Add(existingGuid.ToString()); } @@ -219,6 +208,10 @@ private void OnGUI() { if (_serializedObject) { string dirtyFlag = _graphView.Dirty ? " *" : ""; _loadedLabel.text = $"{_serializedObject.name} - {_propertyName}{dirtyFlag}"; + + if (Application.isPlaying) { + _loadedLabel.text = $"{_loadedLabel.text} !! changes do not take effect in play mode !!"; + } } else { _loadedLabel.text = ""; }