using UnityEngine;
/// <summary>
/// Similar to UIButtonColor, but adds a 'disabled' state.
/// </summary>
[AddComponentMenu("NGUI/Interaction/Button")]
public class UIButton : UIButtonColor
{
/// <summary>
/// Whether the button should be enabled.
/// </summary>
public bool isEnabled = true;
bool mEnabled = true;
void Update ()
{
if (mEnabled != isEnabled)
{
mEnabled = isEnabled;
if (tweenTarget)
{
Color c = defaultColor;
if (!mEnabled)
{
c.r *= 0.75f;
c.g *= 0.75f;
c.b *= 0.75f;
}
TweenColor.Begin(tweenTarget, 0.15f, c);
}
Collider col = collider;
if (col) col.enabled = mEnabled;
}
}
}