Search Unity

ECS Prefabs not updating

Discussion in 'Entity Component System' started by OndrejP, Dec 15, 2019.

  1. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    304
    I have a normal GameObject prefab with component TestValue { Value = 5 }
    There's subscene in my scene, which has component PrefabSpawner { Prefab = that prefab above }

    When I open Entity debugger, everything looks fine, there's few entities and I can identify both spawner and prefab.

    The problem is when I modify my prefab and set value to 8.
    I cannot get the value 8 in Entity debugger (neither in edit mode or play mode).
    I tried
    - reimporting prefab
    - reimporting subscene asset
    - opening subscene, changing something, saving and closing

    The only way to make it work was to create prefab copy, change the value and assign new prefab to PrefabSpawner...which is unacceptable for me.

    Am I missing something? I'd be okay with writing some tool to rebuild all subscenes.
    Using latest entities 0.3.0 and [GenerateAuthoringComponent] on both components.
     
  2. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    304
    What's interesting is that entity version increases with each change to prefab, but the TestValue.Value is not updated.

    EDIT:
    What seems to help is using ConverterVersionAttribute on any authoring component and incrementing version. This is not ideal, but still preferable to manually patching all prefab references. This seems to make full reimport of subscene instead of just updating it (and takes some time).

    Are data changes in subscene / prefabs patched into subscene asset instead of full reimport?
     
    Last edited: Dec 15, 2019
    eatbuckshot likes this.