A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Data Oriented Technology Stack' started by Jotunheimr, May 23, 2018.
Is there a way to enable and disable individual systems programmatically for Unity ECS?
Yes, systems, so ScriptBehaviourManagers have property "Enabled"
EDIT: In newer version Enabled property is from ComponentSystemBase
Do you have a more complete example of how to do this?
public class ComponentSys : ComponentSystem
[Inject] private SomeSystem someSystem;
protected override void OnUpdate()
someSystem.Enabled = false;
public class SomeClass : MonoBehaviour
private void SomeMethod()
World.Active.GetExistingManager<SomeSystem>().Enabled = false;
I see, awesome. I didn't know the system would be the type of the `GetExistingManager` call.
In case anyone needs this, GetExistingManager is now renamed to GetExistingSystem
can you disable a system precompiled? So it is not even in the game?
Hmm - I think at that point you may not even want to create the System automatically using the [DisableAutoCreation] attribute on the system.
If you need later you can always create the system into the world.
ty this is what I was looking for