docs.unity.cn
    Show / Hide Table of Contents

    Method LoadScene

    LoadScene(Object, LoadSceneMode, Boolean, Int32)

    Load scene.

    Declaration
    public static AsyncOperationHandle<SceneInstance> LoadScene(object key, LoadSceneMode loadMode = null, bool activateOnLoad = true, int priority = 100)
    Parameters
    Type Name Description
    Object key

    The key of the location of the scene to load.

    LoadSceneMode loadMode

    Scene load mode.

    Boolean activateOnLoad

    If false, the scene will load but not activate (for background loading). The SceneInstance returned has an Activate() method that can be called to do this at a later point.

    Int32 priority

    Async operation priority for scene loading.

    Returns
    Type Description
    AsyncOperationHandle<SceneInstance>

    The operation handle for the request.

    LoadScene(IResourceLocation, LoadSceneMode, Boolean, Int32)

    Load scene.

    Declaration
    public static AsyncOperationHandle<SceneInstance> LoadScene(IResourceLocation location, LoadSceneMode loadMode = null, bool activateOnLoad = true, int priority = 100)
    Parameters
    Type Name Description
    IResourceLocation location

    The location of the scene to load.

    LoadSceneMode loadMode

    Scene load mode.

    Boolean activateOnLoad

    If false, the scene will load but not activate (for background loading). The SceneInstance returned has an Activate() method that can be called to do this at a later point.

    Int32 priority

    Async operation priority for scene loading.

    Returns
    Type Description
    AsyncOperationHandle<SceneInstance>

    The operation handle for the request.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Friday, March 4, 2022
    Terms of use