Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

ECS Prefabs not updating

Discussion in 'Data Oriented Technology Stack' started by OndrejP, Dec 15, 2019.

  1. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    91
    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:
    91
    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.
unityunity