Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
Fixed method ReloadBaseTypes being called 2 times when entering play …
Browse files Browse the repository at this point in the history
…mode.

The same thing occurs with EditorUtilities.ReloadDecoratorTypes, but the fix cannot be applied in this context.
  • Loading branch information
PierreGac authored and Pierre GAC committed Sep 6, 2019
1 parent a5fe3f1 commit 7cba7a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PostProcessing/Runtime/PostProcessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public static PostProcessManager instance
[UnityEditor.Callbacks.DidReloadScripts]
static void OnEditorReload()
{
instance.ReloadBaseTypes();
// ctor() will also call ReloadBaseTypes. This "dirty" test will avoid 2 calls of ReloadBaseTypes
if (s_Instance == null)
s_Instance = new PostProcessManager();
else
s_Instance.ReloadBaseTypes();
}
#endif

Expand Down

0 comments on commit 7cba7a0

Please sign in to comment.