#Enableable Component default value

1 messages · Page 1 of 1 (latest)

boreal dirge
#

Is there a way to add a IEnableableComponent to an entity which is disabled by default?
What I do now in such cases is add the component and then immediately have another call to disable it.
I assume there should be a way to add it in a disabled state?

errant sphinx
#

i thought support was added for this to bakers around pre.44

#

unless you mean at runtime in which case yeah it'd need a separate call

#

but it kind of leads the question of, why are you making a structural change on an IEnableComponent?

#

whole point of them is to avoid structural changes!

boreal dirge
#

Yeah, it’s for creating a new entity procedurally. Not a big issue, just seems a bit dirty to have another call just for setting the initial state.
I work mostly pure so I don't use bakers or prefabs...

lucid moss
#

what you could do though

#

Is just treat enabled state as disabled in jobs

#

But it might make things a bit dirty with queries