using UnityEngine;
using System.Collections;
public class buttonClick : UIButton
{
protected override void OnClick()
{
Debug.Log("Super Effect!");
}
protected override void OnEnable()
{
StartCoroutine(wait(0));
Debug.Log("OnEnable()");
}
public void Init(Vector3 indent, System.Action action, EventDelegate.Callback callback)
{
this.indent = indent;
this.Clicked = action;
this.callback = callback;
UIEventTrigger trigger = GetComponent<UIEventTrigger>();
EventDelegate.Add(trigger.onHoverOut, callback);
}
IEnumerator wait(float waitTime)
{
yield return new WaitForSeconds
(waitTime
);
transform.localPosition += this.indent;
SetState(State.Disabled, false); // Error
}}