Skip to content

Setting new value of shared component disconnects sharing #179

@slimshader

Description

@slimshader

Hi,

not sure if this a bug or I am missing something but component sharing does not work form me, I do:

var ep = w.CreateEntity();
ep.Set<EnemyPrefab>();
ep.Set(new Color(r, g, b));

at this point I see single Color component in World components

then

  var e = w.CreateEntity();
  e.SetSameAs<Color>(ep);

still seeing a singe Color component in the World.

ep.Set(new Color());

at this point there are 2 Color components in the World, the "prefab" using new one and and "instances" share the one at index 0 meaning I see no change of the color for the instances after changing the shared color of the "prefab".

(trying to emulate https://ajmmertens.medium.com/deconstructing-flecs-prefabs-d604b5ba0fcc with DefaultEcs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions