Skip to content

Commit

Permalink
fix: suprious "not on main thread" warnings from OnPreCull (#400)
Browse files Browse the repository at this point in the history
Closes: #377
  • Loading branch information
bdunderscore authored Sep 16, 2024
1 parent 80d0983 commit 0fd3371
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#399] Fix: Parameter introspection did not skip EditorOnly objects
- [#397] Fix: issues where `ComputeContext` flushes might not be processed at all
- [#398] Fix: NullReferenceError in `GetParameterRemappingsAt`
- [#400] Fix: Spurious complaints about not being on the main thread in OnPreCull

### Changed

Expand Down
11 changes: 7 additions & 4 deletions Editor/PreviewSystem/ProxyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ internal static class ProxyManager
[InitializeOnLoadMethod]
private static void Initialize()
{
Camera.onPreCull += OnPreCull;
Camera.onPostRender += OnPostRender;
EditorSceneManager.sceneSaving += (_, _) => ResetStates();
AssemblyReloadEvents.beforeAssemblyReload += ResetStates;
EditorApplication.delayCall += () =>
{
Camera.onPreCull += OnPreCull;
Camera.onPostRender += OnPostRender;
EditorSceneManager.sceneSaving += (_, _) => ResetStates();
AssemblyReloadEvents.beforeAssemblyReload += ResetStates;
};
}

private static List<(Renderer, bool)> _resetActions = new();
Expand Down

0 comments on commit 0fd3371

Please sign in to comment.