Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
How to change a UI.Button disabled color on runtime?

I want to change the opacity of my buttons disabled color with code in this exact loop so I was wondering how? Maybe sommething like how I disabled interactability. It should be done to tictactoeSpaces too.

        for(int i = 0; i < tictactoeSpaces.Length; i++)
        {
            tictactoeSpaces[i].interactable = false;
        }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Does it need to be via code?

You actually can configure that in the Inspector of the Button component

enter image description here

If you really need to do it on runtime you can change it via the Button.colors property like e.g.

var button = tictactoeSpaces[i];
var colors = button.colors;
var disabledColor = colors.disabledColor;
disabledColor.a = /*NEWALPHA e.g.*/ 0.2f;
colors.disabledColor = disabledColor;
button.colors = colors;

button.interactable = false;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!