Skip to content

Content management tips #278

@Doprez

Description

@Doprez

Been a while but one of the old issues that was bugging me again was seeing what Assets Stride actually has loaded at runtime so the below should help. You just need a reference to the games IContentManager/ContentManager.

reading available assets

easier method of seeing what Stride has loaded for a game at runtime

(Content as ContentManager).FileProvider.ListFiles("", "*", Stride.Core.IO.VirtualSearchOption.AllDirectories);

Root directory: Empty string for root directory
Search pattern: * for anything (Should follow regex logic)
VirtualSearchOption: Recursive(AllDirectories) or ignore folders(TopDirectoryOnly)

adding assets to the db

https://github.com/stride3d/stride/blob/27f87bf78e20cad0c5671ed782e0b46b6fef35e8/sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs#L66

You will need a reference to the ContentManager which should be the only one ever registered to a Stride game so casting should be safe if you have the IContentManager reference instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions