Instantly share code, notes, and snippets.

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.

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