mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +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() {
|
void OnFocus() {
|
||||||
current = this;
|
current = this;
|
||||||
ValidateGraphEditor();
|
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]
|
[InitializeOnLoadMethod]
|
||||||
|
|||||||
@ -17,6 +17,12 @@ namespace XNodeEditor {
|
|||||||
|
|
||||||
/// <summary> Called when opened by NodeEditorWindow </summary>
|
/// <summary> Called when opened by NodeEditorWindow </summary>
|
||||||
public virtual void OnOpen() { }
|
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() {
|
public virtual Texture2D GetGridTexture() {
|
||||||
return NodeEditorPreferences.GetSettings().gridTexture;
|
return NodeEditorPreferences.GetSettings().gridTexture;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user