using texture in different scripts

ok i have a quickbar in gui with gui buttons with textures:

in my attacck script i want to do something like this:

but how do i get to use QuickSlot1Tex and mageSpellTex3 in my attack script because if i do make it a static variable the textures are gone from the buttons.

Assign the inspector values to static vars at runtime in Awake or Start.

Also, consider using arrays - Texture[ ] - as they’re much nicer to code with. when you have stacks of variables like that.

thanks that helped