I have this function:
public static void ToggleUnmanagedSystem<T>(World world, bool state) where T : unmanaged, ISystem
{
world = world == null ? World.DefaultGameObjectInjectionWorld : world;
var handle = world.GetExistingSystem<T>();
var system = world.Unmanaged.ResolveSystemStateRef(handle);
system.Enabled = state;
}```
I call this from a monobehaviour in an update function:
```csharp
private void Update()
{
if (IsStarted)
SystemUtils.EnableUnmanagedSystem<TestSystem>(World.DefaultGameObjectInjectionWorld);
if (Cancel)
SystemUtils.DisabledUnmanagedSystem<TestSystem>(World.DefaultGameObjectInjectionWorld);
}
But in the editor systems window it shows the system greyed out. What am i getting wrong here?