docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SteamAPI

    Client-side Steam API lifecycle. InitEx(out string, SteamDispatchMode) initializes the API and starts callback dispatch; call it on the main thread so callbacks are delivered there. Shutdown() undoes it.

    Inheritance
    object
    SteamAPI
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Steamworks.Interop
    Assembly: Unity.Steamworks.Interop.dll
    Syntax
    public static class SteamAPI

    Methods

    Init(SteamDispatchMode)

    Initializes the Steam API; returns false on any failure (use InitEx(out string, SteamDispatchMode) for details).

    Declaration
    public static bool Init(SteamDispatchMode dispatch = SteamDispatchMode.Package)
    Parameters
    Type Name Description
    SteamDispatchMode dispatch

    Who reads the client pipe's callbacks. Defaults to this package.

    Returns
    Type Description
    bool

    true when the API is ready to use.

    InitEx(out string, SteamDispatchMode)

    Initializes the Steam API; on success resolves its interfaces and starts dispatch for the client pipe.

    Declaration
    public static ESteamAPIInitResult InitEx(out string errMsg, SteamDispatchMode dispatch = SteamDispatchMode.Package)
    Parameters
    Type Name Description
    string errMsg

    Receives Steam's description of the failure, or null on success.

    SteamDispatchMode dispatch

    Who reads the client pipe's callbacks. Defaults to this package.

    Returns
    Type Description
    ESteamAPIInitResult

    k_ESteamAPIInitResult_OK, or the reason initialization failed.

    IsSteamRunning()

    True while a Steam client is running for the current user.

    Declaration
    public static bool IsSteamRunning()
    Returns
    Type Description
    bool

    true when a Steam client is running for the current user.

    ReleaseCurrentThreadMemory()

    Frees the memory Steam keeps for the calling thread; useful on worker threads that call Steam.

    Declaration
    public static void ReleaseCurrentThreadMemory()

    RestartAppIfNecessary(AppId_t)

    If the app was not launched through Steam, asks Steam to relaunch it and returns true. Call before Init(SteamDispatchMode).

    Declaration
    public static bool RestartAppIfNecessary(AppId_t unOwnAppID)
    Parameters
    Type Name Description
    AppId_t unOwnAppID

    The app id to relaunch under.

    Returns
    Type Description
    bool

    true when Steam is relaunching the game, in which case this process should exit.

    Shutdown()

    Stops client-pipe dispatch and shuts the Steam API down.

    Declaration
    public static void Shutdown()
    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)