#System initialization

1 messages · Page 1 of 1 (latest)

stone crest
#

Hello, I would like to start my systems at some point later. I used [DisableAutoCreation] for this, but after that I cannot start my systems.
var playerCameraSystem = World.DefaultGameObjectInjectionWorld.CreateSystem<PlayerCameraSystem>(); Even though I make this call, I cannot succeed. How can I initialize a system later?

muted quail
#

Use entity query to start or stop your systems. Or you can use state.RequireForUpdate<SomeComponent>(). The idea is your system will update only if there is at least 1 entity with SomeComponent exists. If there is none, the system won't ever update. You have to specify this in OnCreate method.