Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/LoadScene.cs
Last active Nov 19, 2018

Embed
What would you like to do?
MultiPhysicsSceneのテスト
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.SceneManagement;
public class LoadScene : MonoBehaviour
{
[SerializeField]
string sceneName = "SubScene";
private PhysicsScene physicsScene;
[SerializeField][Range(0.1f, 5)]
float speed = 1;
void Start()
{
Scene scene = SceneManager.LoadScene(sceneName, new LoadSceneParameters(LoadSceneMode.Additive, LocalPhysicsMode.Physics3D));
physicsScene = scene.GetPhysicsScene();
Assert.IsTrue(physicsScene.IsValid());
}
private void FixedUpdate()
{
physicsScene.Simulate(Time.fixedDeltaTime * speed);
}
}
@tsubaki

This comment has been minimized.

Copy link
Owner Author

commented Nov 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.