I am using Vuforia in Unity which has a built in script called DefaultTrackableEventHandler. It has a code like this;
protected virtual void OnTrackingFound()
{
var rendererComponents = GetComponentsInChildren<Renderer>(true);
foreach (var component in rendererComponents)
component.enabled = true;
}
I have some items with the tag "ignoreRend" which I do not want to be rendered when the tracking finds the target image. I have a list like this:
GameObject[] ignoreTheseObjects = GameObject.FindGameObjectsWithTag("ignoreRend");
I've been trying to find a way to make the foreach loop ignore the items in my ignoreTheseObjects list without any success. It feels like something that would be easy to code but I'm stuck... Is there any way to compare the items in the lists? I've tried searching for answers but haven't found anything that is suitable for this problem. I'm thinking something like;
if (rendererComponents[i] == ignoreTheseObjects[i])
.. but not sure how to write it further. Any help would be appreciated!