Last active
November 19, 2018 12:53
-
-
Save tsubaki/cf0cc1da6770732eb965f0a938bdf677 to your computer and use it in GitHub Desktop.
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