ive tried disabling all systems running in the same group. and while this works, unpausing seems to "catch up" in a way
my thought is, because im using jobs, the jobs cannot be stopped, but how to work around this?
using Unity.Entities;
using Unity.Physics.Systems;
using UnityEngine;
namespace MonoBehaviors
{
public class PauseManager : MonoBehaviour
{
private FixedStepSimulationSystemGroup fixedStepSimulationSystemGroup;
public bool isPaused = false;
void Start()
{
World world = World.DefaultGameObjectInjectionWorld;
fixedStepSimulationSystemGroup = world.GetOrCreateSystemManaged<FixedStepSimulationSystemGroup>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.P))
{
isPaused = !isPaused;
fixedStepSimulationSystemGroup.Enabled = !isPaused;
Debug.Log($"Paused: {isPaused}, Simulation Group Enabled: {fixedStepSimulationSystemGroup.Enabled}");
}
}
}
}```
sorry if this is a dumb question