I put this together a while ago. Maybe you’ll find it useful.
- Single script, plug-and-play.
- Double-click the text area to edit.
Either paste the script below into your project, or install it as a package via the Unity Package Manager using this URL:0
- During build, the
[PostProcessScene]callback removes instances of the component from your scenes.
- Since we can’t remove the entire component from prefabs at build time1, the
ISerializationCallbackReceivercallback clears the comment content.
- You can even use it with ECS since the component won’t be baked at all.
Yes, you can install packages straight from GitHub Gists (if they’re set up with a
.asmdef). I’m as surprised as you are that this actually works, but Gists are built on top of regular Git repositories, so it makes sense. return ︿
I looked, but couldn’t find any way to do this. If I recall correctly, deleting the component during serialization results in an error. I wish we had
[PostProcessPrefab]or something… return ︿