Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Selectable.interactable

マニュアルに切り替える
public bool interactable;

説明

UI.Selectable.interactable。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // required when using UI elements in scripts

public class Example : MonoBehaviour {

public Button startButton; public bool playersReady;

void Update () { // checks if the players are ready and if the start button is useable if (playersReady == true && startButton.interactable == false) { //allows the start button to be used startButton.interactable = true; } } }