Skip to content

Commit

Permalink
Added auto reload on UnityEditor's play state change
Browse files Browse the repository at this point in the history
  • Loading branch information
PeraSite committed Nov 10, 2023
1 parent d1f0f35 commit 78d6e78
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public void Reload(IObjectResolver resolver)
Repaint();
}

void OnPlayModeStateChange(PlayModeStateChange state)
{
treeView.ReloadAndSort();
Repaint();
}

void OnEnable()
{
window = this; // set singleton.
Expand All @@ -76,11 +82,13 @@ void OnEnable()
searchField = new SearchField();

DiagnositcsContext.OnContainerBuilt += Reload;
EditorApplication.playModeStateChanged += OnPlayModeStateChange;
}

void OnDisable()
{
DiagnositcsContext.OnContainerBuilt -= Reload;
EditorApplication.playModeStateChanged -= OnPlayModeStateChange;
}

void OnGUI()
Expand Down Expand Up @@ -205,4 +213,4 @@ void RenderStackTracePanel()
}
}
}
}
}

0 comments on commit 78d6e78

Please sign in to comment.