You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Epic Toon FX/Demo/Scripts/VFX Library/PEButtonScript.cs

40 lines
1.0 KiB
C#

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public enum ButtonTypes {
NotDefined,
Previous,
Next
}
public class PEButtonScript : MonoBehaviour, IEventSystemHandler, IPointerEnterHandler, IPointerExitHandler {
#pragma warning disable 414
private Button myButton;
#pragma warning disable 414
public ButtonTypes ButtonType = ButtonTypes.NotDefined;
// Use this for initialization
void Start () {
myButton = gameObject.GetComponent<Button> ();
}
public void OnPointerEnter(PointerEventData eventData) {
// Used for Tooltip
UICanvasManager.GlobalAccess.MouseOverButton = true;
UICanvasManager.GlobalAccess.UpdateToolTip (ButtonType);
}
public void OnPointerExit(PointerEventData eventData) {
// Used for Tooltip
UICanvasManager.GlobalAccess.MouseOverButton = false;
UICanvasManager.GlobalAccess.ClearToolTip ();
}
public void OnButtonClicked () {
// Button Click Actions
UICanvasManager.GlobalAccess.UIButtonClick(ButtonType);
}
}