stride-docs icon indicating copy to clipboard operation
stride-docs copied to clipboard

Extra Documentation for Custom Assets

Open Doprez opened this issue 10 months ago • 1 comments

There is some additional documentation needed for custom assets for users who want to create an external library not directly in their game project.

If the assembly is in a separate folder and solution you need to add a Module.cs class with the below code for GameStudio to search for asset classes.

using System.Reflection;
using Stride.Core;
using Stride.Core.Reflection;

namespace Doprez.Stride.Items;

internal class Module
{
    [ModuleInitializer]
    public static void Initialize()
    {
        // "AssemblyCommonCategories.Assets" gets registered on startup of the project in GameStudio and allows the template to be created from a separate project.
        AssemblyRegistry.Register(typeof(Module).GetTypeInfo().Assembly, AssemblyCommonCategories.Assets);
    }
}

Make sure that the Module.cs class is within the project that includes the asset class.

Doprez avatar Feb 18 '25 00:02 Doprez

Logged in the main repo in case anyone else runs into the same problem. https://github.com/stride3d/stride/issues/2646

Doprez avatar Feb 18 '25 00:02 Doprez