Getting the other objects from the built-in array. C#

Is there is a way to get the other objects from an array, rather than a specific object from an array.

public Transform[] ItemSlots;
public int Key = 1;

What I am trying to do is change the colour of each “ItemSlots”, to grey, when “Key” is a certain value, this does work, but what I would like to do is change the “ItemSlots” back to it’s original colour when the “Key” value changes, if there is a way.

Please let me know if you need more information.

You can use a loop to do something with each item…

for (int i = 0; i < ItemSlots.Length; i++)
{
  // use the i loop variable as the index
   Transform item = ItemSlots*;*

// TODO : do what you want with item
}