I understand that Layers are used for determining which objects are raycast to, which get renderered, lit, and which objects collide together and Tags are intended to identify GameObjects for scripting purposes.
I have a bunch of collectables in my levels but they have different Tags (“collectableTypeA”, “collectableTypeB” etc, there are 6 different types of them). I want to know each moment, how many collectables (not of a specific type, I want the total number) I’ve got left.
I was thinking that (since they have different Tags) if I had the collectables in a separate layer, that there might be a way to get the number of objects in that layer, at every moment. If not, I will probably try to get the sum by adding objects with the aforementioned Tags (I think by using “GameObject.FindGameObjectsWithTag”).
I just wanted to know if there is a way by using Layers, because if there is, it will be probably easier and in any case it would be useful to know.
If there isn’t though (by using Layers), is the way I mentioned above the right one (that is, by finding the objects with various tags and adding them inside a variable)?