Skip to content

AssetRegistry.getByUrl() returns wrong asset type for same URL (texture vs cubemap) #8489

@gameatp

Description

@gameatp

Hi team,
I encountered an issue with AssetRegistry.getByUrl() when working with cubemap assets:
A PNG file URL is used for both a texture asset and a cubemap asset in the registry.
getByUrl(url) only returns the last added asset (e.g., texture instead of cubemap), even though the cubemap asset with the same URL exists.
Since _urlToAsset is a Map that overwrites entries with the same URL, getByUrl() can’t distinguish assets by type, which makes it impossible to reliably retrieve cubemap assets via URL (a common use case for skyboxes).
Is there a recommended way to get an asset by URL + type (instead of just URL) to avoid this conflict? Or could getByUrl() be enhanced to support type filtering?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions