Version: 2017.1
public Color pressedColor ;

描述

按下颜色。

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 Pressed color to the new color. ColorBlock cb = button.colors; cb.pressedColor = newColor; button.colors = cb; } }