summaryrefslogtreecommitdiff
path: root/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs')
-rw-r--r--Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs
new file mode 100644
index 0000000..d58c358
--- /dev/null
+++ b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/Raycasters/BaseRaycaster.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+
+namespace UnityEngine.EventSystems
+{
+ public abstract class BaseRaycaster : UIBehaviour
+ {
+ public abstract void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList);
+ public abstract Camera eventCamera { get; }
+
+ [Obsolete("Please use sortOrderPriority and renderOrderPriority", false)]
+ public virtual int priority
+ {
+ get { return 0; }
+ }
+
+ public virtual int sortOrderPriority
+ {
+ get { return int.MinValue; }
+ }
+
+ public virtual int renderOrderPriority
+ {
+ get { return int.MinValue; }
+ }
+
+ public override string ToString()
+ {
+ return "Name: " + gameObject + "\n" +
+ "eventCamera: " + eventCamera + "\n" +
+ "sortOrderPriority: " + sortOrderPriority + "\n" +
+ "renderOrderPriority: " + renderOrderPriority;
+ }
+
+ // 只要是继承了BaseRaycaster的都会自动加到raycaster的列表里面
+ protected override void OnEnable()
+ {
+ base.OnEnable();
+ RaycasterManager.AddRaycaster(this);
+ }
+
+ protected override void OnDisable()
+ {
+ RaycasterManager.RemoveRaycasters(this);
+ base.OnDisable();
+ }
+ }
+}