UI.Selectable.IsInteractable。
#pragma strict // required when using UI elements in scripts public class Example { public var startButton; function Update() { if (!startButton.IsInteractable()) { Debug.Log("Start Button has been Disabled"); } } }
using UnityEngine; using System.Collections; using UnityEngine.UI; // required when using UI elements in scripts
public class Example : MonoBehaviour { public Button startButton; void Update () { if (!startButton.IsInteractable ()) { Debug.Log("Start Button has been Disabled"); } } }