as above. i know i can write values manually there but id like to write them from monobehaviour script
I mean IComponentData
Any reason why you need write from monobehaviour?
It is much easier to convert into entity prefab and update values as required.
i want to preset values in IComponentDatas en masse in editor via code
only other solution is to somehow read the values from Monobehaviour OnStart or read them from disk (also OnStart)
BUT i find that approach very inelegant, i would love to set the values via code when its all in the editor
You can create MB fields, which can be populated in editor.
Then use EntityConversion approach, like in case of IConvertGameObjectToEntity.
so you would still have to get these mb fields from entity during game OnStart?
MB fields are not on entity. They are still on Go. During startup go is converted to entity and is destroyed, unless otherwise set in the inspector. Corresponding fields from go can be used, to create relevant components for your entity at the conversion time.
But you can populate go fields in the editor as you like. Or using some tools and automation etc.
yeah the thing is i dont know any of such tools that would let me write the data there, i would write the tool myself but get component doesnt work
and how is this done via code? is there any special function or do you just use override protected void OnStart or some other method?
I suggest you look int dots ample git repos, and look for IConvertGameObjectToEntity keywords.
You can just do whatever needed with go mono behaviour component, which holds also entity conversion.