Search Unity

[feature] reference assets in folders (belonging to asset groups) withour extensions

Discussion in 'Addressables' started by nik_d, Jun 12, 2019.

  1. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    50
    premiss: loading screen textures make different people ))
    workaround: AddressableAssetEntry.cs GetRelativePath(...)

    Code (CSharp):
    1.             //**addressables - asset addresses in folder without extension
    2.             var i = file.LastIndexOf('.');
    3.             if (i > 0) {
    4.                 file = file.Substring(0, i);
    5.             }
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    If we did this, it would have to be an opt-in. We wouldn't want to force it to no-extension only. And we wouldn't want to default to having both available given the bloat to the content catalog.
     
  3. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    50
    I agree - it's controversial.

    But can describe the way I came with it:
    * at first time with addressables I used "Simplify Entry Names" command a lot (it makes without extension)
    * it was easier to port a lot of Resources.Load() code (mostly without extension - especially for sprite/texture assets: png/jpg)
    * after switching to assets referencing via folders - decided to get rid extensions there

    Customizable way in any case should win: custom name-to-address-method for the folder or just regular expression mapping. I don't see clearly - what is better. )
     
  4. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    I will add that we are planning to explore how assets in folders are dealt with in general over the coming months. There are a lot of items on this list (naming, extensions, labels, etc.).

    Thanks for your input. We'll add this extension piece to the list to look at as we work on making folders easier to manage.
     
    nik_d likes this.