Last active
November 19, 2018 12:53
Star
You must be signed in to star a gist
MultiPhysicsSceneのテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://tsubakit1.hateblo.jp/entry/2018/11/19/215036