Class RuntimeMaterials
Holds a list of archives and records and uses them to assign materials when the prefab is instantiated at runtime. Materials are automatically applied on Awake or, if DaggerfallWorkshop.Utility.AssetInjection.RuntimeMaterials.UseDungeonTextureTable is true, as part of dungeon layout or when requested with an overload of ApplyMaterials().
Namespace: DaggerfallWorkshop.Utility.AssetInjection
Assembly: Assembly-CSharp.dll
Syntax
[RequireComponent(typeof(MeshRenderer))]
public sealed class RuntimeMaterials : MonoBehaviour
Methods
| Improve this Doc View SourceApplyMaterials()
Applies materials to MeshRender found on gameobject using existing configuration.
Declaration
[ContextMenu("Reapply Materials")]
public void ApplyMaterials()
ApplyMaterials(RuntimeMaterial[])
Applies materials to MeshRender found on gameobject with the given configuration.
Declaration
public void ApplyMaterials(RuntimeMaterial[] materials)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMaterial[] | materials |
ApplyMaterials(Int32[], RuntimeMaterial[])
Applies materials to MeshRender found on gameobject with the given dungeon texture table and optionally overrides configuration.
Declaration
public void ApplyMaterials(int[] dungeonTextureTable, RuntimeMaterial[] materials = null)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | dungeonTextureTable | Texture table to be used. |
RuntimeMaterial[] | materials | Overrides materials configuration if not null. |