Search Unity

Many (many!) Undemanded Changes In Scenes And Prefabs

Discussion in 'Editor & General Support' started by PJBowron, Apr 10, 2019.

  1. PJBowron

    PJBowron

    Joined:
    Dec 13, 2016
    Posts:
    8
    I'm looking for advice on how to eliminate or at least reduce the amount of undemanded modifications the Editor makes to scenes and prefab content - sometimes just by simply opening up a scene.

    Many changes seem to come from TextMeshPro components, massive swathes of 'havePropertiesChanged' and 'inputParsingRequired' data changes; these changes can spill out of prefabs and end up as overrides in the main scene - nullifying the prefab's capability to segregate changes, which has become even more powerful under the upgraded prefab system.

    It's not just undemanded changes polluting the data, the editor often simply moves chunks of configuration (see the attached image) for... what reason?
    prefabMeddling.png

    This isn't an unfocussed rant (well, not entirely). Our project has quite a complex UI hierarchy formed from many prefabs, Variants and instances. Stopping and playing the editor now often causes transient data to be written to several prefabs, several times over, and since prefab update is relatively time consuming (there's a pop-up & progress bar now), there's a significant hit to productivity. The editor (2018.3.7f1) may also crash during the process. All in all I do not feel very confident that we're building a robust, production-ready product.

    Any thoughts welcome!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Are you able to reproduce these issues? Can you file a bug report so we can investigate?
     
  3. PJBowron

    PJBowron

    Joined:
    Dec 13, 2016
    Posts:
    8
    Hi Karl, thanks for the response. We're crunching at the moment so its hard to find time to do this 'properly', but I'll try and formalise and make a test case asap.
    In the meantime, any general advice? This isn't a new problem, it's been a part of the Unity experience for at least my 2.5 years of exposure :)
     
  4. PJBowron

    PJBowron

    Joined:
    Dec 13, 2016
    Posts:
    8
    An update: we discovered the cause - well, the trigger - of the 'cascading prefab update' issue described in the OP:

    We have a MonoBehaviour responsible for the selection and display of one of a set of GameObject subhierarchies (via go.SetActive), depending on the value of an internal state variable. The MonoBehavior had an OnValidate function, allowing our designers to preview their selection in the Editor. Removing this function has stopped the issue.

    My guess is that because the subhierarchies contain components that cause transient data changes (e.g. driven transforms or TextMeshGUIs), this data is being modified multiple times. Not sure why this should be; perhaps the monobehaviour is first processed when its state variable has its initializer value; then a value is assigned to it by the editor, causing another update; but why the multiple prefab updates? Something is going wrong in that process, anyway.