More target graphics on one Button? TMPro

Hello guys can you please help me.

I have Button script with 2 assignable variables , text and image.

If this button is not interactable then i can set different color for text , but how can i set this also for image?
I tried set alpha for but that is not working.

I am using TMPro and on button i only can set targetable graphic for one item so i set it for text.

Screens attached

I want both text and image have lower alpha when button is not interactable.
I think what i need is to be able to set more button “Target graphics” for one button.

Thanks for help.


I don’t think it’s possible in the default button implementation. Write a little mini-component that matches another target graphic’s alpha in LateUpdate, or extend your own Button class and override the functionality as needed.

Thanks for reply but i am not rly sure what do you mean by “override the functionality as needed” you mean edit TMP button component somehow?I

EDIT : I found way how to do it i just get color from that interactable color for text target and use it for image and it is working.For some reason it wasnt working for me before but it is working now i probably made some mystake before.

Button thisButton;
public Image butImage;
if(butImage != null&& !thisButton.interactable)
            {
                butImage.color = thisButton.colors.disabledColor;
            }