No, that’s not what I meant but that’s an excellent solution, doing that will also solve your problem without having to modify your code, and it’s actually a far better solution because it helps you keep your code simply and it avoids certain issues.
I’ll explain what an array is, just for you to be clear. An array is a type of list that you can create in C#, it is written with the following syntax:
Material[] _myMaterials;
//The brackets indicate that it is an array, a type of list.
//You can even see how it works in the inspector.
//if you are curious, try this out INSTEAD.
[SerializeField] Material[] _myMaterials = null;
//Then you'll be able to see the array in the inspector,
//You'll see that it is quite similar to the image you posted.
–
An array can be populated with a lot of variables of the same type, in this case, the type is Material. If you create an array and then populate it with all the materials of your model, then you can go through all of them and change their color, or you can even specify which material you want to change, really amazing stuff.
If you still don’t follow what I’m saying, worry not, you’ll see them and use them during the course quite a few times, enough for you to get used to them.
Oh, and welcome to the community! Hope you have a great time here! Sorry for not noticing that this was your first post when I previously replied to you.