Repository navigation
Unity Guide
Supports Unity 2021.3+ via the netstandard2.1 build. It is IL2CPP-safe (CI runs a NativeAOT smoke test).
Add to Packages/manifest.json:
{
"scopedRegistries": [
{ "name": "OpenUPM", "url": "https://package.openupm.com", "scopes": ["com.rogueliketoolkit"] },
{ "name": "UnityNuGet", "url": "https://unitynuget-registry.openupm.com", "scopes": ["org.nuget"] }
],
"dependencies": {
"com.rogueliketoolkit.entities": "6.0.0",
"com.rogueliketoolkit.entities.scripting.jint": "6.0.0"
}
}Drop the scripting line if you do not use scripts. Check the releases page for the current version.
Download RoguelikeToolkit.Entities-<version>-unity-plugins.zip from a GitHub Release and unzip into Assets/Plugins/RoguelikeToolkit.Entities/. Skip DLLs your project already has (e.g. System.Runtime.CompilerServices.Unsafe).
Your component types are populated by reflection. Protect them with [Preserve] or an Assets/link.xml:
<linker>
<assembly fullname="MyGame.Components" preserve="all" />
</linker>The packages preserve themselves, DefaultEcs, YamlDotNet and Jint automatically.
AotComponentRegistry.Register<Health>(); // once per component type at startupUse Application.streamingAssetsPath or persistentDataPath for template folders; on platforms where StreamingAssets is not a real folder (Android), read the text yourself and call repository.LoadTemplate(name, content).
RoguelikeToolkit.Entities