Stride Forums Archive

Is there hava MemberwiseClone method with entity clone?

4 posts, 1443 views, 2016-09-05 to 2016-09-08

xxf2103625 2016-09-05 #1

I see the Entity.clone() is a deep clone,is it have a MemberwiseClone method?

Kryptos (Nicolas Musset) 2016-09-06 #2

Entity does not have a member-wise clone method. What would be the use case?

An entity is mainly a container of entity components. An entity component can belong to one entity only and each entity has a unique Id. The only properties remaining for a member-wise clone would be the entity name and its group.

If there is a scene hava many same entity just different width position.
Use deep clone will take up a lot of memory.
Reference types is better ,is it?
Xenko hava solution in this scene?

Nicogo (Goosse Nicolas) 2016-09-08 #6

you should use an InstancingShader (Tutorial here) and just one entity to handle that.

For example, if you’re making a minecraft-like, juste create an entity “World” and make it draw and handle all the cubes.