Search Unity

Case 1084178: Addressable Group modifications using the Addressable Assets window are not set dirty.

Discussion in 'Addressables' started by AlkisFortuneFish, Sep 24, 2018.

  1. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    I've been integrating the addressables system into one of our projects and run into an issue. Long story short, the Addressable Assets editor window does not set AddressableAssetGroup assets dirty when they are modified via drag and drop.

    After having lost my changes a couple of times I realised what was happening and thankfully I have a "Set Dirty" asset context menu in our project that allows us to set the assets dirty manually and hence serialize the changes.

    Peeking into this via ILSpy (where is the source repository, BTW? ;-)), it would appear that HandleDragAndDrop() calls CreateOrMoveEntry() with postEvent set to false and then calls PostModificationEvent which is supposed to do the... dirty work. However, that actually sets the AddressableAssetSettings and AddressableAssetEntry assets dirty, not the AddressableAssetGroup.

    Out of curiosity, what is the point of tying the SetDirty() call to the post event and control it with a flag? SetDirty is not exactly slow, even for very large numbers of assets. Moreover, why are none of these modifications actually recorded with the Undo system?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for the feedback. As the bug itself is in, and discussed elsewhere, I'll just comment on your other points...

    Where is source? - the source is on your computer. The exact path depends on being Windows or Mac (somewhere in a user folder either way), but I believe you should be able to get to it from within Unity. It's definitely all on your computer ready to view.

    Why not a public repo? - that is our intent, but we haven't gotten it out there yet.

    Why not "undo" instead of dirty? - undo doesn't work in all cases, so as a quick first-pass, we've been using dirty. We have on our to-do list the work to go back and move as much as possible over to using Unity's Undo.

    -Bill
     
  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Oh! I was not aware of that! Beautiful, I can temporarily fix the issue on our end for now! :)

    Looking forward to it!

    Cool. We have enough custom tooling to have experienced quite a lot of the cases where it does not work, so I can empathise, makes sense to do as much development work as possible without it, especially where secondary data structures have to be rebuilt when undo occurs.