docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct InputStateHistory.Record

    State change record

    Implements
    IEquatable<InputStateHistory.Record>
    Namespace: UnityEngine.InputSystem.LowLevel
    Assembly: Unity.InputSystem.dll
    Syntax
    public struct InputStateHistory.Record : IEquatable<InputStateHistory.Record>
    Remarks

    Input State change record stored in the InputStateHistory.

    Properties

    control

    The control associated with the input state record.

    Declaration
    public InputControl control { get; }
    Property Value
    Type Description
    InputControl

    The control associated with the input state record.

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value.

    See Also
    InputStateHistory

    index

    The index of the input state record in the owning container.

    Declaration
    public int index { get; }
    Property Value
    Type Description
    int

    The index of the input state record in the owning container.

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value.

    See Also
    InputStateHistory

    next

    The next input state record in the owning container.

    Declaration
    public InputStateHistory.Record next { get; }
    Property Value
    Type Description
    InputStateHistory.Record

    The next input state record in the owning InputStateHistorycontainer.

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value.

    See Also
    InputStateHistory

    owner

    Identifies the owning container for the record.

    Declaration
    public InputStateHistory owner { get; }
    Property Value
    Type Description
    InputStateHistory

    The owning InputStateHistory container for the record.

    Remarks

    Identifies the owning InputStateHistory container for the record.

    See Also
    InputStateHistory

    previous

    The previous input state record in the owning container.

    Declaration
    public InputStateHistory.Record previous { get; }
    Property Value
    Type Description
    InputStateHistory.Record

    The previous input state record in the owning InputStateHistorycontainer.

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value.

    See Also
    InputStateHistory

    time

    The time stamp of the input state record.

    Declaration
    public double time { get; }
    Property Value
    Type Description
    double

    The time stamp of the input state record in the owning container. currentTime

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value.

    See Also
    InputStateHistory

    valid

    Identifies if the record is valid.

    Declaration
    public bool valid { get; }
    Property Value
    Type Description
    bool

    True if the record is a valid entry. False if invalid.

    Remarks

    When the history is cleared with Clear() the entries become invalid.

    See Also
    InputStateHistory

    Methods

    CopyFrom(Record)

    Copy data from one record to another.

    Declaration
    public void CopyFrom(InputStateHistory.Record record)
    Parameters
    Type Name Description
    InputStateHistory.Record record

    Source record to copy from.

    Remarks

    Copy data from one record to another.

    Exceptions
    Type Condition
    ArgumentException

    When the source record history is not valid.

    InvalidOperationException

    When the control is not tracked by the owning InputStateHistory container.

    See Also
    InputStateHistory

    Equals(object)

    Compare two records.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The record to compare with.

    Returns
    Type Description
    bool

    True if the records are the same, False if they differ.

    Overrides
    ValueType.Equals(object)
    Remarks

    Compare two records.

    See Also
    InputStateHistory

    Equals(Record)

    Compare two records.

    Declaration
    public bool Equals(InputStateHistory.Record other)
    Parameters
    Type Name Description
    InputStateHistory.Record other

    The record to compare with.

    Returns
    Type Description
    bool

    True if the records are the same, False if they differ.

    Remarks

    Compare two records.

    See Also
    InputStateHistory

    GetHashCode()

    Return the hash code of the record.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The hash code of the record.

    Overrides
    ValueType.GetHashCode()
    Remarks

    Return the hash code of the record.

    See Also
    InputStateHistory

    GetUnsafeExtraMemoryPtr()

    Read the extra memory for the record.

    Declaration
    public void* GetUnsafeExtraMemoryPtr()
    Returns
    Type Description
    void*

    The extra memory for the record.

    Remarks

    Additional date can be stored in a record in the extra memory section.

    See Also
    extraMemoryPerRecord

    GetUnsafeMemoryPtr()

    Read the state memory for the record.

    Declaration
    public void* GetUnsafeMemoryPtr()
    Returns
    Type Description
    void*

    The state memory for the record.

    Remarks

    Read the state memory for the record.

    See Also
    InputStateHistory

    ReadValueAsObject()

    Read the control's final, processed value from the given state and return the value as an object.

    Declaration
    public object ReadValueAsObject()
    Returns
    Type Description
    object

    The value of the control associated with the record.

    Remarks

    This method allocates GC memory and should not be used during normal gameplay operation.

    Exceptions
    Type Condition
    InvalidOperationException

    When the specified value is not present.

    See Also
    InputStateHistory

    ReadValue<TValue>()

    Returns value from the control in the record.

    Declaration
    public TValue ReadValue<TValue>() where TValue : struct
    Returns
    Type Description
    TValue

    Returns the value from the record.

    Type Parameters
    Name Description
    TValue

    The type of the value being read

    Exceptions
    Type Condition
    InvalidOperationException

    When the record is no longer value or the specified type is not present.

    See Also
    InputStateHistory

    ToString()

    Return the string representation of the record.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The string representation of the record.

    Overrides
    ValueType.ToString()
    Remarks

    Includes the control, value and time of the record (or <Invalid> if not valid).

    See Also
    InputStateHistory

    Implements

    IEquatable<T>

    See Also

    InputStateHistory
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)