#Getting acces to SystemState in a method in an ISystem

1 messages · Page 1 of 1 (latest)

gritty beacon
#

Trying to experiment a bit with a few ideas but is there a way in an ISystem to access the ref to the SystemState ? Like to disable the system OUTSIDE of a generic method with the ref in parameters ?

Example :
translating this method from a system base to a ISystem

private void EnableSelf()
{ 
   Enabled = true; <== this is what i'm trying to access
}

Basically trying to do this :

public void OnUpdate(ref SystemState state)
{
   state.Enabled = true;
}

Outide of the predetermine OnXXX Methods ( for whatever reasons )

ripe badge
gritty beacon
ripe badge
#

neither you should do it for system base

#

this is extremely anti-ecs

gritty beacon
#

Yeah I know. As I say it's mostly to experiment nothing else.

I'm looking at way to reduce boilerplating in some cases

Thanks for the answer.

ripe badge
#

best alternative - use RequireForUpdate

gritty beacon
#

Do you have a resource for some good pattern for ecs ?

gritty beacon
ripe badge
#

and then simply by existance of entity with component (or specific query) you can declare what systems run, without even knowing them

gritty beacon
#

yep

gritty beacon
ripe badge