Skip to content

Allow adding and removing asset sources at runtime. #21758

Description

@andriyDev

Currently, all asset sources must be registered before the asset plugin is initialized. This effectively means that asset sources are fixed for the entire lifetime of your game.

Ideally, asset sources should be able to be added or removed at runtime. For example, a mod for a game could store its data as a ZIP file, and this ZIP file could be added as an extra asset source. Then the mod's assets can be loaded just like any other asset.

Removing asset sources should also be supported as something like a mod may wish to be unloaded to reduce memory usage.

This also could resolve #10162 since of course asset sources added after the AssetPlugin must also be accounted for (though this may result in the opposite problem that asset sources registered before the AssetPlugin may fail, but that is much less surprising).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-FeatureA new feature, making something new possibleS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions