I'm using a "toggle visibility" script on many objects in my scene, and in my
gameController class I'm storing references to them in an array like this:
public Fields fields;
then I access them by the array index:
This works fine, but this list is growing and everything is getting unmaintainable.
So I would like to iterate thru the references to the objects, find the script by its game object name, and call the required function
A call, if possible should look like this:
In this way, I would have a clear overview of my code.
Is this possible in Unity C#?