1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

Fixed error on adding nodes in scene graphs

This commit is contained in:
Thor Brigsted 2020-04-03 11:26:12 +02:00
parent 6a69cdaf9c
commit f3b211ed83

View File

@ -143,7 +143,7 @@ namespace XNodeEditor {
Undo.RegisterCreatedObjectUndo(node, "Create Node"); Undo.RegisterCreatedObjectUndo(node, "Create Node");
node.position = position; node.position = position;
if (node.name == null || node.name.Trim() == "") node.name = NodeEditorUtilities.NodeDefaultName(type); if (node.name == null || node.name.Trim() == "") node.name = NodeEditorUtilities.NodeDefaultName(type);
AssetDatabase.AddObjectToAsset(node, target); if (!string.IsNullOrEmpty(AssetDatabase.GetAssetPath(target))) AssetDatabase.AddObjectToAsset(node, target);
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
NodeEditorWindow.RepaintAll(); NodeEditorWindow.RepaintAll();
return node; return node;