19 lines
583 B
C#
19 lines
583 B
C#
|
|
//----------------------------------------------
|
|||
|
|
// NGUI: Next-Gen UI kit
|
|||
|
|
// Copyright <20> 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); }
|
|||
|
|
}
|