Skip to content

Group Name Replacement via RegEx Capture - Can't force lowercase group name with \L #56

@nindim

Description

@nindim

Bug report

Bug category

  • Importer: issues related to the importer behaviours or UI.

Steps to reproduce

Follow the docs to setup a group name via RegEx Capture: https://github.com/favoyang/unity-addressable-importer/blob/master/Documentation~/AddressableImporter.md#group-replacement

Ensure the files making up the group name have some uppercase letters.

Set the group name to "\L${name}\E".

What is expected?

It is expected that the filename be extarcted and forced to lowercase.

What is actually happening?

The filename is being extracted but it is not lowercase and it has prefixes and suffixes as such:

"-Lbaseballcap1_Variant1-E"

Expected group name is: "baseballcap1_variant1" (note the lowercase 'v')

Other relevant information

I have files with mixed cases in different folders that I need to combine into a single Addressable group:

Example:
"Assets/Models/Baseball_Cap_Variant1.fbx"
"Assets/Prefabs/baseball_cap_variant1.prefab"

I would like both files to be stored in the same addressable group and as I can't rename the files the easiest way to achieve that seems to be to force a lowercase group name for both rules.

Without this support my groups are getting very messed up when allowing group creation as Addressables reloads from disk mid-import and it breaks all my groups!

I tracked it down to this code executing in AddressableAssetGroupSchema::AddSchema():

var assetName = pathFunc(type); if (File.Exists(assetName)) { Debug.LogWarningFormat("Schema asset already exists at path {0}, relinking.", assetName); var existingSchema = AssetDatabase.LoadAssetAtPath(assetName, type) as AddressableAssetGroupSchema; m_Schemas.Add(existingSchema); return existingSchema; }

Thank you for your help!

  • OS (Win/Mac/Linux/Others): Windows 10
  • Unity version: 2018.4.23
  • Addressables version: 1.16.10
  • Unity Addressable Importer version: 0.9.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions