docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct WarnAboutApplicationRunInBackground

    If you disable UnityEngine.Application.runInBackground, users will experience client disconnects when tabbing out of (or otherwise un-focusing) your game application. It is therefore highly recommended to enable "Run in "Background" via ticking Project Settings... Player... Resolution and Presentation... Run In Background.

    Implements
    ISystem
    ISystemStartStop
    ISystemCompilerGenerated
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    [RequireMatchingQueriesForUpdate]
    [WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation|WorldSystemFilterFlags.ClientSimulation, WorldSystemFilterFlags.Default)]
    [UpdateInGroup(typeof(SimulationSystemGroup))]
    public struct WarnAboutApplicationRunInBackground : ISystem, ISystemStartStop, ISystemCompilerGenerated
    Remarks

    Setting SuppressApplicationRunInBackgroundWarning to true will allow you to toggle off "Run in Background" without triggering the advice log.

    Methods

    OnCreate(ref SystemState)

    Require user to be connected to show this warning.

    Declaration
    public void OnCreate(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnCreateForCompiler(ref SystemState)

    Declaration
    public void OnCreateForCompiler(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnStartRunning(ref SystemState)

    Reset the warning as we've disconnected.

    Declaration
    public void OnStartRunning(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnStopRunning(ref SystemState)

    Does nothing.

    Declaration
    public void OnStopRunning(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnUpdate(ref SystemState)

    Handle raising the warning.

    Declaration
    public void OnUpdate(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    Implements

    Unity.Entities.ISystem
    Unity.Entities.ISystemStartStop
    Unity.Entities.ISystemCompilerGenerated
    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)