ColorBlock.selectedColor

public Color selectedColor;

Description

Selected Color.

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class ExampleClass : MonoBehaviour { public Button button; public Color newColor;

void Start() { //Changes the button's Selected color to the new color. ColorBlock cb = button.colors; cb.selectedColor = newColor; button.colors = cb; } }

Did you find this page useful? Please give it a rating: