Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there any way to ignore the file extension after you drag entire folder instead of a file

Discussion in 'Addressables' started by VictorQianUnity, Aug 27, 2019.

  1. VictorQianUnity

    VictorQianUnity

    Joined:
    Nov 13, 2015
    Posts:
    30
    Edits:
    "I know you can change the address string, when you drag an asset into the addressable.
    But when i drag a whole folder of assets into the addressable, the address under the folder are gray out with file extension."

    Some of my sprites use .PSD some are PNG, i know it not a good practice, but still can i ignore the file extension when using addressable? so i don't have to write stuff like path + ".PSD"
     

    Attached Files:

    Last edited: Aug 27, 2019
  2. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    70
    You can set the addressable name to whatever you like, just be sure that there aren't duplicate keys (names).
     
    VictorQianUnity likes this.
  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Plus, to make this a little more automated, you can use @Favo-Yang's Addressables Importer. You can generate the names for the bundles using RegEx, so you could easily strip the extension.
     
  4. VictorQianUnity

    VictorQianUnity

    Joined:
    Nov 13, 2015
    Posts:
    30
    Sorry i didn't state my question clearly, what i really mean is can you rename the address when you drag a folder into the addressable window, for me all the assets below the folder are grayout, i can only change the root path name
     

    Attached Files:

    danilonishimura likes this.
  5. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    66
    You can have duplicate addresses. I have a lot of them applying label rules to find exact required resource location.
    same-address-names.png
     
    Last edited: Aug 27, 2019
    VictorQianUnity likes this.
  6. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    66
    VictorQianUnity likes this.
  7. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Personally, I’d recommend not dragging folders in at the moment. The workflow for that is too primitive, you get very little control over anything. I’d recommend using that importer I linked to or writing your own. Maybe in future this will change but right now having addressable folders where you actually care about the contents, rather than them being explicit dependencies, mainly has disadvantages and very few advantages.
     
    VictorQianUnity likes this.
  8. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    70
    Didn't know that. Thanks for the info!