Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active November 19, 2018 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/cf0cc1da6770732eb965f0a938bdf677 to your computer and use it in GitHub Desktop.
Save tsubaki/cf0cc1da6770732eb965f0a938bdf677 to your computer and use it in GitHub Desktop.
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
Copy link
Author

tsubaki commented Nov 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment