- Home /
Question by
$$anonymous$$ · Apr 07, 2017 at 02:54 PM ·
colorbuttonscolor change
Why does a button disappear when changing the ColorBlock?
Hello, if i change the ColorBlock of a button when anybody clicks at it, the button disappears. It is enabled and active, but disappeared. That's the code: public Color color;
private ColorBlock cb;
public Button button;
public void setColor()
{
cb = button.colors;
cb.normalColor = color;
cb.disabledColor = color;
cb.highlightedColor = color;
cb.pressedColor = color;
button.colors = cb;
}
I hope anybody can help me.
Comment