Untitled
Anonymous
plain_text
02/13/2026 2:23 AM
744 B
10
Indexable
using UnityEngine;
using UnityEngine.SceneManagement;
public class PhysicsSimulator2D : MonoBehaviour
{
private PhysicsScene2D _physicsScene2D;
private void Start()
{
Scene currentScene = gameObject.scene;
_physicsScene2D = currentScene.GetPhysicsScene2D();
Debug.Log($"PhysicsSimulator2D started in scene {currentScene.name}");
}
private void FixedUpdate()
{
if (_physicsScene2D.IsValid())
{
_physicsScene2D.Simulate(Time.fixedDeltaTime);
}
}
}Editor is loading...
Leave a Comment