- Home /
Tag-based gameobject exclusion
Hello,
I need to make a scene that includes platform-specific assets. There are several ways to achieve that, including (but not limited to):
1) putting all resources in the scene as inactive, then activate the relevant one in the Awake of some "manager" object
2) putting all resources in the scene as active, then attach each of them a monobehaviour that destroy them (or make them inactive) if they are not relevant
3) moving the assets in the Resources folder and load them as needed
Neither of these solutions is optimal. 1 and 2 will require unnecessary loading the unneeded resources, while 3 will require a call to Resources.Load which is blocking, thus making LoadLevelAsync pointless.
However, all three solutions have a bigger drawback: all the resources (needed and unneeded) will be built and will therefore end up in the final executable. I'd like to avoid that.
I see that there is a built-in tag EditorOnly that you can use to strip a gameobject (and its children) during the build process. Is there something similar that could be used?
Answer by iaanus · Sep 15, 2014 at 10:04 AM
Found that you can do almost everything by simply exploiting the PostProcessScene attribute.
Your answer
Follow this Question
Related Questions
excluding resources when targetting flash 0 Answers
Is there something similar to EditorOnly tag that will only show an object in the scene view? 1 Answer
getting children of the parent but excluding objects with certain tag 2 Answers
Exclude self in 'findgameobjectswithtag' ? 2 Answers
How to get a Texture asset that is in the project and pass it to a function? 3 Answers