I need help with lists.
I often find myself confused when trying to put things other than game objects into a list. For example, I want to use
public List<Image> images;
and look at all of them and get their Color
component, but I can’t figure it out.
So, instead, I have to change each one individually
{
chageColor1.GetComponent<Image>().color = customeColorDarkColor;
chageColor2.GetComponent<Image>().color = customeColorDarkColor;
chageColor3.GetComponent<Image>().color = customeColorDarkColor;
}
else
{
chageColor1.GetComponent<Image>().color = Color.red;
chageColor2.GetComponent<Image>().color = Color.red;
chageColor3.GetComponent<Image>().color = Color.red;
}
Which is annoying.
I also run into this problem with lists with KeyCode
s or anything you can put into a list.
So, if you can help, that would be appreciated.
Thank You.