Component comps = this.gameObject.GetComponent();
for(int i=0;i<comps.length;i++)
{
Component c = comps*;*
Type t = c.GetType();
if(t.FullName == “TrackRenderer”)
{
- this.gameObject.GetComponent().enabled = true;*
}
else
{
this.gameObject.GetComponent().enabled = false;
}
}
The error I get with this is:
The type or namespace name ‘c’ could not be found.
I have a few gameobjects with this script attached to it, each one has a few different scripts attached to it, but they always have a TrackRenderer.
The thing I want to do is disable all those scripts and keep the TrackRenderer enabled.
Anyone have suggestions?