mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
2D Physics and script improvements
- fixed time step - Fixed crash caused by physics script callback being registered in simulation mode - Moved 2D Physics config to file - Finally gave up on the attempt to keep X and Y rotation when applying new Z-rotation from 2D rigidbody to transform and now I can sleep well - Streamlined starting and stopping of scenes - Scripts: execute all inits and OnCreates before OnUpdate
This commit is contained in:
@@ -919,8 +919,7 @@ namespace GlitchyEditor
|
||||
/// @param startSimulation If set to true, the physics simulation will be initialized for the given scene.
|
||||
private void SetActiveScene(Scene scene, bool startRuntime, bool startSimulation, PlayMode? newPlayMode = null)
|
||||
{
|
||||
_activeScene?.StopRuntime();
|
||||
_activeScene?.StopSimulation();
|
||||
_activeScene?.Stop();
|
||||
|
||||
if (newPlayMode != null)
|
||||
{
|
||||
@@ -939,11 +938,7 @@ namespace GlitchyEditor
|
||||
|
||||
if (scene != null)
|
||||
{
|
||||
if (startRuntime)
|
||||
scene.StartRuntime();
|
||||
|
||||
if (startSimulation)
|
||||
scene.StartSimulation();
|
||||
scene.Start(startRuntime, startSimulation);
|
||||
}
|
||||
|
||||
SetReference!(_activeScene, scene);
|
||||
@@ -1058,10 +1053,7 @@ namespace GlitchyEditor
|
||||
/// Sets the current editor scene
|
||||
private void SetEditorScene(Scene scene, Dictionary<UUID, SerializedObject> serializedObjects = null)
|
||||
{
|
||||
if (_editorScene != null)
|
||||
{
|
||||
_editorScene.StopRuntime();
|
||||
}
|
||||
_editorScene?.Stop();
|
||||
|
||||
SetReference!(_editorScene, scene);
|
||||
_editor.CurrentScene = _editorScene;
|
||||
@@ -1069,7 +1061,7 @@ namespace GlitchyEditor
|
||||
|
||||
if (_editorScene != null)
|
||||
{
|
||||
_editorScene.StartRuntime();
|
||||
_editorScene.Start(startRuntime: true, startSimulation: false);
|
||||
|
||||
if (serializedObjects != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user