Jump to content

UE4's DataAsset analog


photo

Recommended Posts

I need a way to store some "config" data, so it could be editable from editor.

Properties looks like a way to go. And I see 2 choices :

  1) create manual .prop "prototype" file, then make a child from it in editor;

  2) make component, and inherit generated .prop file.

So, with option 1 I'll have overhead of searching property value "by name", and also opportunity to mistype and misname it.

With option 2 - everything looks good.... Except I don't actually need a component. I just need data struct. What about "update()" ticking every frame?

 

Is there overhead of having bunch of properties "just for data"? Maybe properties is not the right tool, and I need something like json files (I need to point to animation, meshes, etc.)?

P.S. My data is not associated directly with objects / nodes, BTW. Currently, I'm loading properties by file names.

Edited by tower120
Link to comment

Hi tower120,

Unfortunately, there is no DataAsset analogue in the Unigine. But we are thinking about it and will implement it in the future.
All you can do now is to use "raw" properties, yes.

What about "update()" ticking every frame?
If you don't use it (there is no such method in your component) - it will not be called.

Is there overhead of having bunch of properties "just for data"?
Of course there is, but insignificant. We use maps to find your properties by name. The number of properties affects performance only when loading nodes with attached components from files.

Best regards,
Alexander

Link to comment

Hmm - in that case, ComponentBase with parameters only is good as is, I suppose... Just a little weird to see them in Editor Property (Component?) tree...

 

[My personal whining]:

You know, for people I presented Unigine, "properties" sounds a little bit misleading ... They expect them to be some kind of data container, or even just single values.

I would say they are rather "traits"... Maybe that's due to C# and Rust meanings of the words, but...

Or why not just components? It is weird to link component to property...

Again, just my personal opinion.

Link to comment
×
×
  • Create New...