From b1276a1b76ac3b87add90e0c6b887d5afea1cfea Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 11 Oct 2020 09:12:08 +0800 Subject: =?UTF-8?q?*event=20system=E5=88=9D=E6=8E=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/CapsuleButton.cs | 24 ++++++++++++++++++++++++ Assets/Scripts/CapsuleButton.cs.meta | 11 +++++++++++ Assets/Scripts/PicoButton.cs | 24 ++++++++++++++++++++++++ Assets/Scripts/PicoButton.cs.meta | 11 +++++++++++ 4 files changed, 70 insertions(+) create mode 100644 Assets/Scripts/CapsuleButton.cs create mode 100644 Assets/Scripts/CapsuleButton.cs.meta create mode 100644 Assets/Scripts/PicoButton.cs create mode 100644 Assets/Scripts/PicoButton.cs.meta (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/CapsuleButton.cs b/Assets/Scripts/CapsuleButton.cs new file mode 100644 index 0000000..9adee0f --- /dev/null +++ b/Assets/Scripts/CapsuleButton.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.EventSystems; + +public class CapsuleButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler +{ + public virtual void OnPointerClick(PointerEventData eventData) + { + Debug.Log("CapsuleButton.OnPointerClick"); + } + + public virtual void OnPointerUp(PointerEventData eventData) + { + Debug.Log("CapsuleButton.OnPointerUp"); + } + + public virtual void OnPointerDown(PointerEventData eventData) + { + Debug.Log("CapsuleButton.OnPointerDown"); + } + +} diff --git a/Assets/Scripts/CapsuleButton.cs.meta b/Assets/Scripts/CapsuleButton.cs.meta new file mode 100644 index 0000000..7ec7b59 --- /dev/null +++ b/Assets/Scripts/CapsuleButton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71800034947a58040a0004d4225a9007 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PicoButton.cs b/Assets/Scripts/PicoButton.cs new file mode 100644 index 0000000..385f90f --- /dev/null +++ b/Assets/Scripts/PicoButton.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.EventSystems; + +public class PicoButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler +{ + public virtual void OnPointerClick(PointerEventData eventData) + { + Debug.Log("PicoButton.OnPointerClick"); + } + + public virtual void OnPointerUp(PointerEventData eventData) + { + Debug.Log("PicoButton.OnPointerUp"); + } + + public virtual void OnPointerDown(PointerEventData eventData) + { + Debug.Log("PicoButton.OnPointerDown"); + } + +} diff --git a/Assets/Scripts/PicoButton.cs.meta b/Assets/Scripts/PicoButton.cs.meta new file mode 100644 index 0000000..76c9e9b --- /dev/null +++ b/Assets/Scripts/PicoButton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8048cdebd1089744b99076ef93c3f3b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0