UIButtonActivate.cs 312 B

123456789101112131415161718
  1. using System;
  2. using UnityEngine;
  3. [AddComponentMenu("NGUI/Interaction/Button Activate")]
  4. public class UIButtonActivate : MonoBehaviour
  5. {
  6. private void OnClick()
  7. {
  8. if (this.target != null)
  9. {
  10. NGUITools.SetActive(this.target, this.state);
  11. }
  12. }
  13. public GameObject target;
  14. public bool state = true;
  15. }