Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

(Case 1091572) Editor hangs on every launch after the first launch

Discussion in '2018.3 Beta' started by DougRichardson, Oct 17, 2018.

  1. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    Note: this is a convoluted bug to reproduce, but it took me a day and a half to figure out, so I'm going to post it here in case it might help someone else.

    I ran into an issue where the editor would hang every launch in 2018.3.0b5 if a particular scene was the last scene that was loaded. I isolated the hang to an interaction between Wwise's Unity plugin and the Easy Character Movement's CharacterMovement class.

    Easy Character Movement has a component that updates a Rigidbody SerialziedField (useGravity = true) in it's OnValidate method. The Wwise Unity plugin implemented a EditorApplication.delayCall callback that ended up calling AssetDatabase.SaveAssets, and this callback was registered in an UnityEditor.InitializeOnLoad static constructor.

    If the last scene I had open in the editor contained a GameObject that referenced a prefab with the Easy Character Movement component, then the next time I opened the Unity editor it would hang 100% of the time.

    There is a note in AssetDatabase.SaveAssets docs that say it shouldn't be called during serialization, so my best guess is that is what is causing the hang. On the other hand, the Wwise code isn't obviously wrong since it's calling SaveAssets in a delayCall callback (perhaps they should be checking EditorApplication.isUpdating, but I'm not sure).

    I was not able to reproduce this hang in any 2018.2 build.
     
    SugoiDev and LeonhardP like this.
  2. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    I've also submitted a bug to Wwise (#AFC-77359-899) since it isn't clear to me where the problem lies. On one hand, perhaps Wwise can do something to avoid calling SaveAssets when they aren't supposed to. On the other hand, Unity probably shouldn't lock up without at least issuing an error message when this occurs.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136