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

Commit 405e91c

Browse files
committed
Better handling of deleted custom effects
1 parent 95783cb commit 405e91c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

PostProcessing/Runtime/PostProcessProfile.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ public sealed class PostProcessProfile : ScriptableObject
1212
[NonSerialized]
1313
public bool isDirty = true;
1414

15+
void OnEnable()
16+
{
17+
// Make sure every setting is valid. If a profile holds a script that doesn't exist
18+
// anymore, nuke it to keep the profile clean. Note that if you delete a script that is
19+
// currently in use in a profile you'll still get a one-time error in the console, it's
20+
// harmless and happens because Unity does a redraw of the editor (and thus the current
21+
// frame) before the recompilation step.
22+
settings.RemoveAll(x => x == null);
23+
}
24+
1525
public void Reset()
1626
{
1727
isDirty = true;

0 commit comments

Comments
 (0)