Accessing multiple components

Hi,

I am converting my game from unityscript to C# and i have a problem the guiTexture’s color.
In unityscript you can change the guiTexture.color.a without affecting the rgb channels.

I know in c# we have to store the Color in a variable, but i would i go about storing the color of
multiple guitextures without affecting rgb.

This is what i got so far but it doesn’t really work.

    private Color HalfColor;
   
    void  Start (){

        foreach(GameObject GuiOpacity in GameObject.FindGameObjectsWithTag("UnselectedGui")){

            HalfColor = GuiOpacity.GetComponent<GUITexture>().color;
        }
  }

        FullColor.a = 0.5f;
}

I tried Color.gray but it also resets rgb values.

Thank you

If you have an array of guiTextures (from FindGameObjectsWithTag) and you want to store the color of each, then you likewise need an array of colors
Iterate with index (instead of foreach) and do colors[index] = objectArray[index].Getcomponent…