Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

PhysicsSceneLoadScope

struct in UnityEngine

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Scope used during scene load operations such as SceneManager.LoadSceneAsync, with the purpose of providing a different physics scene than the global one. <![CDATA[ using UnityEngine; using UnityEngine.SceneManagement;

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); } } }

]]>

Properties

Property Description
scene The physics scene used within this scope.

Constructors

Constructor Description
PhysicsSceneLoadScope Construct a new physics scene loading scope.

Public Methods

Method Description
Dispose Dispose of the current physics scene loading scope.