1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

Call NodeEditorWindow methods when focus change

This commit is contained in:
Romain Théry 2020-04-23 11:03:14 +02:00 committed by GitHub
parent 4386099d59
commit c0b76fbb35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,15 @@ namespace XNodeEditor {
void OnFocus() {
current = this;
ValidateGraphEditor();
if (graphEditor != null && NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
if (graphEditor != null)
{
graphEditor.OnWindowFocus();
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
}
}
void OnLostFocus() {
if (graphEditor != null) graphEditor.OnWindowFocusLost();
}
[InitializeOnLoadMethod]