docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputEvent

    This type can be used inside IInputComponentData to store input events.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    Syntax
    public struct InputEvent
    Remarks

    When this type is used it's ensured that single input events like jumping or triggers will be properly detected exactly once by the server.

    Fields

    Count

    Track if the event has been set for the current frame

    Declaration
    public uint Count
    Field Value
    Type Description
    UInt32
    Remarks

    This could be higher than 1 when the inputs are sampled multiple times before the input is sent to the server. Also if the input is sampled again before being transmitted the set event will not be overridden to the unset state (count=0).

    Properties

    IsSet

    Returns true when a new input event was detected (last known tick this was unset).

    Declaration
    public readonly bool IsSet { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Set()

    Set or enable the input event for current tick.

    Declaration
    public void Set()
    In This Article
    • Fields
      • Count
    • Properties
      • IsSet
    • Methods
      • Set()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023