Skip to content

Instantly share code, notes, and snippets.

@yuw-unknown
Created August 14, 2017 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuw-unknown/c40400594e03e7a9f9a61d353561f9ba to your computer and use it in GitHub Desktop.
Save yuw-unknown/c40400594e03e7a9f9a61d353561f9ba to your computer and use it in GitHub Desktop.
Arborを用いたボタンの活性/非活性
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Arbor {
/**
* ボタンを活性/非活性にします
*/
[AddComponentMenu("")]
[AddBehaviourMenu("UI/Button/ボタンの活性、非活性")]
[BuiltInBehaviour]
public class ArborButtonInteractable : StateBehaviour {
[SerializeField] private UnityEngine.UI.Button _Button;
[SerializeField] private bool _Interactable;
public override void OnStateBegin() {
if (_Button) {
_Button.interactable = _Interactable;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment