using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class PopupButton : MonoBehaviour
{
		
		public enum Direction
		{
				Show,
				Hide
		}
	
		public Direction direction;
		public string popupName;
		
		
		void OnEnable ()
		{
				if (popupName == "")
						popupName = NGUITools.FindInParents<Popup> (transform).name;
		}
		
		void OnClick ()
		{
				if (direction == Direction.Show) {
						PopupManager.instance.PopupTweenIn (popupName);
				} else {
						PopupManager.instance.PopupTweenOut (popupName, true);
				}
		}
		
}
