Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsSceneLoadScope

Scope used during scene load operations such as SceneManager.LoadSceneAsync, with the purpose of providing a different physics scene than the global one. public class SimpleLoader: MonoBehaviour { IEnumerator Start() { int buildIndex0 = 0; int buildIndex1 = 1; var newScene = SceneManagement.SceneManager.LoadScene(buildIndex0, new LoadSceneParameters() { localPhysicsMode = LocalPhysicsMode.Physics3D }); var localPhys = newScene.GetPhysicsScene(); using(new PhysicsSceneLoadScope(localPhys)) { SceneManagement.SceneManager.LoadSceneAsync(buildIndex1); } } } ]]>
Read time 1 minuteLast updated 4 days ago

Definition

public struct PhysicsSceneLoadScope : IDisposable

Constructors

Constructor

Description

PhysicsSceneLoadScope(UnityEngine.PhysicsScene)Construct a new physics scene loading scope.

Properties

Property

Description

sceneThe physics scene used within this scope.

Methods

Method

Description

DisposeDispose of the current physics scene loading scope.