using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NNToolz : MonoBehaviour {
public static Dictionary<int,Color> colorStore;
public static void RegisterButtons (UIImageButton button)
{
colorStore.Add (button.target.gameObject.GetInstanceID (), button.target.color);
}
public static void DeactivateButton (UIImageButton button)
{
if (button.GetComponent<NNDontDeactivateThis> ())
return;
if (colorStore == null)
colorStore
= new Dictionary
<int,Color
> (); try {
colorStore.Add (button.target.gameObject.GetInstanceID (), button.target.color);
} catch {
}
button.target.color = Color.gray;
button.collider.enabled = false;
}
public static void ReactivateButton (UIImageButton button)
{
if (button.GetComponent<NNDontDeactivateThis> ())
return;
button.collider.enabled = true;
if (colorStore == null)
colorStore
= new Dictionary
<int,Color
> (); try {
button.target.color = colorStore [button.target.gameObject.GetInstanceID ()];
} catch {
colorStore.Add (button.target.gameObject.GetInstanceID (), button.target.color);
}
}
}