docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SteamCallbackMessage

    A raw Steam callback as delivered to the OnCallback event. Payload points into a dispatcher-owned buffer that is valid only during the handler call: decode it there with As<T>() and copy out any data that must outlive the call.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Steamworks.Interop
    Assembly: Unity.Steamworks.Interop.dll
    Syntax
    public readonly struct SteamCallbackMessage

    Fields

    CallbackId

    The callback id; compare it with a callback struct's k_iCallback.

    Declaration
    public readonly int CallbackId
    Field Value
    Type Description
    int

    Payload

    The callback payload; valid only inside the handler.

    Declaration
    public readonly IntPtr Payload
    Field Value
    Type Description
    IntPtr

    Size

    Size in bytes of the payload.

    Declaration
    public readonly int Size
    Field Value
    Type Description
    int

    SteamUser

    The Steam user this callback applies to.

    Declaration
    public readonly int SteamUser
    Field Value
    Type Description
    int

    Methods

    As<T>()

    Decodes the payload as a callback struct; call it only inside the handler that received the message.

    Declaration
    public T As<T>() where T : struct
    Returns
    Type Description
    T

    The payload decoded as T.

    Type Parameters
    Name Description
    T

    The callback struct this message carries.

    Exceptions
    Type Condition
    InvalidOperationException

    The message has no payload, or T is larger than the payload.

    In This Article
    Back to top
    Copyright © 2026 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)