Project_WL/Assets/ThirdParty/NGUI/Scripts/Interaction/UIButtonActivate.cs

19 lines
593 B
C#

//-------------------------------------------------
// NGUI: Next-Gen UI kit
// Copyright © 2011-2019 Tasharen Entertainment Inc
//-------------------------------------------------
using UnityEngine;
/// <summary>
/// Very basic script that will activate or deactivate an object (and all of its children) when clicked.
/// </summary>
[AddComponentMenu("NGUI/Interaction/Button Activate")]
public class UIButtonActivate : MonoBehaviour
{
public GameObject target;
public bool state = true;
void OnClick () { if (target != null) NGUITools.SetActive(target, state); }
}