Files
Main/Assets/Launcher/ExternalLibs/NGUI/Scripts/Interaction/UIButtonActivate.cs
2025-01-25 04:38:09 +08:00

19 lines
583 B
C#

//----------------------------------------------
// NGUI: Next-Gen UI kit
// Copyright © 2011-2015 Tasharen Entertainment
//----------------------------------------------
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); }
}