TextStudio3DMaterialRegionRegistry
public sealed class TextStudio3DMaterialRegionRegistryPer-renderer, per-build registry for semantic regions emitted by custom geometry modules. Built-in region values remain stable at 0-8; custom values are assigned deterministically from registration order beginning at 9.
Methods
Section titled “Methods”
Register(string, string, Material, MaterialRegion, TextStudioSurfaceMask)
Section titled “Register(string, string, Material, MaterialRegion, TextStudioSurfaceMask)”public MaterialRegion Register(string id, string displayName, Material material = null, MaterialRegion fallbackRegion = MaterialRegion.Decoration, TextStudioSurfaceMask surfaceMask = TextStudioSurfaceMask.Decorations)Registers or finds a provider-owned semantic region. Re-registering the same ID returns its existing region, allowing cooperating callbacks to share one stable slot.
Parameters
| Name | Type |
|---|---|
id |
System.String |
displayName |
System.String |
material |
UnityEngine.Material |
fallbackRegion |
TextStudio.ThreeD.MaterialRegion |
surfaceMask |
TextStudio.TextStudioSurfaceMask |
Returns
TextStudio.ThreeD.MaterialRegion
TryGetRegion(string, out MaterialRegion)
Section titled “TryGetRegion(string, out MaterialRegion)”public bool TryGetRegion(string id, out MaterialRegion region)Finds a custom region by its stable provider-owned ID.
Parameters
| Name | Type |
|---|---|
id |
System.String |
region |
TextStudio.ThreeD.MaterialRegion |
Returns
System.Boolean
EnsureRegionCapacity(ref GlyphMeshData)
Section titled “EnsureRegionCapacity(ref GlyphMeshData)”public void EnsureRegionCapacity(ref GlyphMeshData mesh)Expands a glyph’s region table so it can receive registered custom ranges.
Parameters
| Name | Type |
|---|---|
mesh |
TextStudio.ThreeD.GlyphMeshData |
AssignRange(ref GlyphMeshData, MaterialRegion, int, int)
Section titled “AssignRange(ref GlyphMeshData, MaterialRegion, int, int)”public void AssignRange(ref GlyphMeshData mesh, MaterialRegion region, int start, int count)Assigns a contiguous triangle range to a built-in or registered region. The mesh’s index buffer remains provider-owned; this method validates and expands only the semantic table.
Parameters
| Name | Type |
|---|---|
mesh |
TextStudio.ThreeD.GlyphMeshData |
region |
TextStudio.ThreeD.MaterialRegion |
start |
System.Int32 |
count |
System.Int32 |
Constructors
Section titled “Constructors”
TextStudio3DMaterialRegionRegistry()
Section titled “TextStudio3DMaterialRegionRegistry()”public TextStudio3DMaterialRegionRegistry()Properties
Section titled “Properties”
public int Count { get; }Total built-in and custom region slots in the current build.
Returns
System.Int32
CustomCount
Section titled “CustomCount”public int CustomCount { get; }Number of custom regions in the current build.
Returns
System.Int32
Definitions
Section titled “Definitions”public IReadOnlyList<TextStudio3DMaterialRegionDefinition> Definitions { get; }Registered custom definitions in deterministic slot order.
Returns
System.Collections.Generic.IReadOnlyList{TextStudio.ThreeD.TextStudio3DMaterialRegionDefinition}