TriLib
Search Results for

    Show / Hide Table of Contents

    Class AbstractInputSystem

    Represents a base class to abstract input system actions.
    This class automatically detects whether the old input system (UnityEngine.Input) or the new input system (UnityEngine.InputSystem) is available, and delegates input calls accordingly.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    AbstractInputSystem
    AssetViewer
    AvatarController
    AvatarLoader
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    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, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, 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, bool)
    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, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TriLibCore.Samples
    Assembly: Assembly-CSharp.dll
    Syntax
    public class AbstractInputSystem : MonoBehaviour

    Methods

    GetAxis(string)

    Retrieves the value of the specified axis (e.g., "Horizontal", "Vertical", "Mouse X", "Mouse Y") using either the legacy or the new input system.
    On mobile devices, touch movement is used to simulate mouse axis behavior.

    Declaration
    protected float GetAxis(string axisName)
    Parameters
    Type Name Description
    string axisName

    Name of the axis to retrieve. Common examples: "Horizontal", "Vertical", "Mouse X", "Mouse Y".

    Returns
    Type Description
    float

    The current axis value, generally in the range [-1, 1], though mouse deltas and touch movements may produce different ranges. Defaults to 0 if unsupported.

    GetKey(KeyCode)

    Determines if a given keyboard key is currently being pressed, using either the new input system or the legacy system.

    Declaration
    protected bool GetKey(KeyCode keyCode)
    Parameters
    Type Name Description
    KeyCode keyCode

    The Unity KeyCode to check (e.g., KeyCode.LeftAlt).

    Returns
    Type Description
    bool

    True if the specified key is pressed; otherwise, false.

    GetMouseButton(int)

    Gets whether a specified mouse button (or equivalent gesture on mobile) is currently pressed.
    Returns true when the requested button is down in the current frame.

    Declaration
    protected bool GetMouseButton(int index)
    Parameters
    Type Name Description
    int index

    The mouse button index:

    • 0 = Left Button
    • 1 = Right Button (legacy mode) / Middle Button (new input system)
    • 2 = Middle Button (legacy mode) / Right Button (new input system)
    Note: On some mobile devices with multi-touch, index=2 can be forced true when multiple touches are present.
    Returns
    Type Description
    bool

    True if the specified mouse button (or gesture) is currently pressed; otherwise, false.

    GetMouseButtonDown(int)

    Gets whether a specified mouse button was pressed down this frame (or equivalent gesture on mobile).
    Returns true only during the frame the user starts pressing the button/gesture.

    Declaration
    protected bool GetMouseButtonDown(int index)
    Parameters
    Type Name Description
    int index

    The mouse button index:

    • 0 = Left Button
    • 1 = Middle Button (legacy mode) / Right Button (new input system)
    • 2 = Right Button (legacy mode) / Middle Button (new input system)
    Returns
    Type Description
    bool

    True if the specified mouse button (or gesture) was pressed down during this frame; otherwise, false.

    GetMouseScrollDelta()

    Retrieves the current scroll delta on desktop or simulates it via pinch gestures on mobile.
    On mobile devices with multi-touch, the difference in touch distances is used to emulate a scroll wheel.

    Declaration
    protected Vector2 GetMouseScrollDelta()
    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 representing the scroll delta.

    Extension Methods

    IObjectExtensions.TryToDispose<T>(object)
    In this article
    Back to top Generated by DocFX