i am referencing a lot of scripts into an array on the inspector, but, any of those are the same.
so… i don’t want to use GetComponent<T>() because is slow, but at the same time i don’t want to create a reference for every possible script.
this is what i did: I created a Object[] and set the scripts that i want to use, when i want to get a reference from that script i just use (T)Object. like on the field.
I found it is best to make a list(or array) of scripts, not gameObjects. This way you can easily reference anything in said object’s class. And Andrew makes a very good point^… When it comes to the Animator or the Renderer, or anything like that it’s better to just cache them. So you can easily handle from another script with:
OtherScript.staticReference.anim.enabled = false;
It not only makes the game more efficient, it makes your life easier. I too have gone down the rabbit hole of battling the downside of GetComponent() , more you can read on that subject here :