Search Unity

Questions about SubScene workflow

Discussion in 'Entity Component System' started by zephyr831125, Jan 8, 2020.

  1. zephyr831125

    zephyr831125

    Joined:
    Mar 4, 2017
    Posts:
    54
    upload_2020-1-8_16-59-18.png
    I have set name and buffer in Conver function. But it doesn't have name or those buffers in Entity Debugger after closed the subscene or in play mode.
    upload_2020-1-8_17-2-56.png
    (Note: the other components added in Convert() are truly added)
     
  2. zephyr831125

    zephyr831125

    Joined:
    Mar 4, 2017
    Posts:
    54
    After several tests, I realized it's maybe because the subscene binary doesn't automatically "refresh" after I changed code in Convert(). I tried Edit and Close, and Unload and Load the subscene. it's still not refreshing it. So how to force the subscene to refresh after changed the Convert code in IConvertGameObjectToEntity?
     
  3. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247
    There is an attribute to do exactly that :) Mark your AgentAuthoring class with ConverterVersion and update the version whenever you change your conversion logic. Doing this invalidates your saved version and will regenerate it.

    See example here:
    https://github.com/Unity-Technologi...vanced/Boids/Scripts/BoidObstacleAuthoring.cs
     
    cultureulterior likes this.
  4. zephyr831125

    zephyr831125

    Joined:
    Mar 4, 2017
    Posts:
    54
    siggigg likes this.