In a project, we have many scenes, each with its own PhysicsSettings, so we need to save the original PhysicsSettings data to use after loading each game to reset the settings. I used the following class to handle it
public static class PhysicsSettings
{
private static Vector3 gravity = Physics.gravity;
//other settings
private static Vector2 gravity2D = Physics2D.gravity;
//other settings
public static void Reset()
{
Physics.gravity = gravity;
//other settings
Physics2D.gravity = gravity2D;
//other settings
}
}
Is there any better solution?