mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Add virtual OnWindowFocus and OnWindowFocusLost in NodeGraphEditor(#253)
This commit is contained in:
parent
ff2c1e8158
commit
c298b5ee53
@ -77,7 +77,14 @@ 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]
|
||||
|
||||
@ -18,6 +18,12 @@ namespace XNodeEditor {
|
||||
/// <summary> Called when opened by NodeEditorWindow </summary>
|
||||
public virtual void OnOpen() { }
|
||||
|
||||
/// <summary> Called when NodeEditorWindow gains focus </summary>
|
||||
public virtual void OnWindowFocus() { }
|
||||
|
||||
/// <summary> Called when NodeEditorWindow loses focus </summary>
|
||||
public virtual void OnWindowFocusLost() { }
|
||||
|
||||
public virtual Texture2D GetGridTexture() {
|
||||
return NodeEditorPreferences.GetSettings().gridTexture;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user