docs.unity.cn
    Show / Hide Table of Contents

    Class PointerInputModule

    A BaseInputModule for pointer input.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    UIBehaviour
    BaseInputModule
    PointerInputModule
    StandaloneInputModule
    TouchInputModule
    Inherited Members
    BaseInputModule.m_RaycastResultCache
    BaseInputModule.m_InputOverride
    BaseInputModule.input
    BaseInputModule.inputOverride
    BaseInputModule.eventSystem
    BaseInputModule.OnEnable()
    BaseInputModule.OnDisable()
    BaseInputModule.Process()
    BaseInputModule.FindFirstRaycast(List<RaycastResult>)
    BaseInputModule.DetermineMoveDirection(Single, Single)
    BaseInputModule.DetermineMoveDirection(Single, Single, Single)
    BaseInputModule.FindCommonRoot(GameObject, GameObject)
    BaseInputModule.HandlePointerExitAndEnter(PointerEventData, GameObject)
    BaseInputModule.GetAxisEventData(Single, Single, Single)
    BaseInputModule.GetBaseEventData()
    BaseInputModule.ShouldActivateModule()
    BaseInputModule.DeactivateModule()
    BaseInputModule.ActivateModule()
    BaseInputModule.UpdateModule()
    BaseInputModule.IsModuleSupported()
    BaseInputModule.ConvertUIToolkitPointerId(PointerEventData)
    UIBehaviour.Awake()
    UIBehaviour.Start()
    UIBehaviour.OnDestroy()
    UIBehaviour.IsActive()
    UIBehaviour.OnRectTransformDimensionsChange()
    UIBehaviour.OnBeforeTransformParentChanged()
    UIBehaviour.OnTransformParentChanged()
    UIBehaviour.OnDidApplyAnimationProperties()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.OnCanvasHierarchyChanged()
    UIBehaviour.IsDestroyed()
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, Boolean)
    Component.GetComponentInParent(Type)
    UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    UnityEngine.Object.FindFirstObjectByType<T>()
    UnityEngine.Object.FindAnyObjectByType<T>()
    UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
    UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.name
    Object.hideFlags
    Namespace: UnityEngine.EventSystems
    Syntax
    public abstract class PointerInputModule : BaseInputModule

    Fields

    kFakeTouchesId

    Touch id for when simulating touches on a non touch device.

    Declaration
    public const int kFakeTouchesId = -4
    Field Value
    Type Description
    Int32

    kMouseLeftId

    Id of the cached left mouse pointer event.

    Declaration
    public const int kMouseLeftId = -1
    Field Value
    Type Description
    Int32

    kMouseMiddleId

    Id of the cached middle mouse pointer event.

    Declaration
    public const int kMouseMiddleId = -3
    Field Value
    Type Description
    Int32

    kMouseRightId

    Id of the cached right mouse pointer event.

    Declaration
    public const int kMouseRightId = -2
    Field Value
    Type Description
    Int32

    m_PointerData

    Declaration
    protected Dictionary<int, PointerEventData> m_PointerData
    Field Value
    Type Description
    Dictionary<Int32, PointerEventData>

    Methods

    ClearSelection()

    Clear all pointers and deselect any selected objects in the EventSystem.

    Declaration
    protected void ClearSelection()

    CopyFromTo(PointerEventData, PointerEventData)

    Copy one PointerEventData to another.

    Declaration
    protected void CopyFromTo(PointerEventData from, PointerEventData to)
    Parameters
    Type Name Description
    PointerEventData from
    PointerEventData to

    DeselectIfSelectionChanged(GameObject, BaseEventData)

    Deselect the current selected GameObject if the currently pointed-at GameObject is different.

    Declaration
    protected void DeselectIfSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent)
    Parameters
    Type Name Description
    GameObject currentOverGo

    The GameObject the pointer is currently over.

    BaseEventData pointerEvent

    Current event data.

    GetLastPointerEventData(Int32)

    Return the last PointerEventData for the given touch / mouse id.

    Declaration
    protected PointerEventData GetLastPointerEventData(int id)
    Parameters
    Type Name Description
    Int32 id
    Returns
    Type Description
    PointerEventData

    GetMousePointerEventData()

    Return the current MouseState. Using the default pointer.

    Declaration
    protected virtual PointerInputModule.MouseState GetMousePointerEventData()
    Returns
    Type Description
    PointerInputModule.MouseState

    GetMousePointerEventData(Int32)

    Return the current MouseState.

    Declaration
    protected virtual PointerInputModule.MouseState GetMousePointerEventData(int id)
    Parameters
    Type Name Description
    Int32 id
    Returns
    Type Description
    PointerInputModule.MouseState

    GetPointerData(Int32, out PointerEventData, Boolean)

    Search the cache for currently active pointers, return true if found.

    Declaration
    protected bool GetPointerData(int id, out PointerEventData data, bool create)
    Parameters
    Type Name Description
    Int32 id

    Touch ID

    PointerEventData data

    Found data

    Boolean create

    If not found should it be created

    Returns
    Type Description
    Boolean

    True if pointer is found.

    GetTouchPointerEventData(Touch, out Boolean, out Boolean)

    Given a touch populate the PointerEventData and return if we are pressed or released.

    Declaration
    protected PointerEventData GetTouchPointerEventData(Touch input, out bool pressed, out bool released)
    Parameters
    Type Name Description
    Touch input

    Touch being processed

    Boolean pressed

    Are we pressed this frame

    Boolean released

    Are we released this frame

    Returns
    Type Description
    PointerEventData

    IsPointerOverGameObject(Int32)

    Declaration
    public override bool IsPointerOverGameObject(int pointerId)
    Parameters
    Type Name Description
    Int32 pointerId
    Returns
    Type Description
    Boolean
    Overrides
    BaseInputModule.IsPointerOverGameObject(Int32)

    ProcessDrag(PointerEventData)

    Process the drag for the current frame with the given pointer event.

    Declaration
    protected virtual void ProcessDrag(PointerEventData pointerEvent)
    Parameters
    Type Name Description
    PointerEventData pointerEvent

    ProcessMove(PointerEventData)

    Process movement for the current frame with the given pointer event.

    Declaration
    protected virtual void ProcessMove(PointerEventData pointerEvent)
    Parameters
    Type Name Description
    PointerEventData pointerEvent

    RemovePointerData(PointerEventData)

    Remove the PointerEventData from the cache.

    Declaration
    protected void RemovePointerData(PointerEventData data)
    Parameters
    Type Name Description
    PointerEventData data

    StateForMouseButton(Int32)

    Given a mouse button return the current state for the frame.

    Declaration
    protected PointerEventData.FramePressState StateForMouseButton(int buttonId)
    Parameters
    Type Name Description
    Int32 buttonId

    Mouse button ID

    Returns
    Type Description
    PointerEventData.FramePressState

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    Extension Methods

    UIBehaviourExtensions.InvokeOnEnable(UIBehaviour)
    UIBehaviourExtensions.InvokeOnDisable(UIBehaviour)
    UIBehaviourExtensions.InvokeAwake(UIBehaviour)
    UIBehaviourExtensions.InvokeRebuild(UIBehaviour, CanvasUpdate)
    UIBehaviourExtensions.InvokeLateUpdate(UIBehaviour)
    UIBehaviourExtensions.InvokeUpdate(UIBehaviour)
    UIBehaviourExtensions.InvokeOnRectTransformDimensionsChange(UIBehaviour)
    UIBehaviourExtensions.InvokeOnCanvasGroupChanged(UIBehaviour)
    UIBehaviourExtensions.InvokeOnDidApplyAnimationProperties(UIBehaviour)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023