Class MaterialPropertyRandomizerTag
Randomizes the shader properties of an object when used in conjunction with MaterialPropertyRandomizer.
Inheritance
MaterialPropertyRandomizerTag
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.Perception.Randomization.Randomizers
Assembly: Unity.Perception.Runtime.dll
Syntax
[AddComponentMenu("Perception/RandomizerTags/Material Property Randomizer Tag")]
[Serializable]
[RequireComponent(typeof(Renderer))]
[MovedFrom("UnityEngine.Perception.Internal")]
public class MaterialPropertyRandomizerTag : RandomizerTag
Fields
propertiesToRandomize
The shader properties which will be randomized on the selected material element.
Declaration
[Tooltip("The shader properties which will be randomized on the selected material element.")]
[SerializeReference]
public List<ShaderPropertyEntry> propertiesToRandomize
Field Value
Type | Description |
---|---|
List<ShaderPropertyEntry> |
targetedMaterialIndex
The index of the material element whose shader properties will be randomized based on the options below.
Declaration
[Tooltip("The index of the material element whose shader properties will be randomized based on the options below.")]
public int targetedMaterialIndex
Field Value
Type | Description |
---|---|
int |
Properties
Renderer
The Renderer component attached to the GameObject which has the MaterialSwapperRandomizerTag.
Declaration
public Renderer Renderer { get; }
Property Value
Type | Description |
---|---|
Renderer |
attachedMaterialsCount
Number of shared material elements which are not set to None.
Declaration
public int attachedMaterialsCount { get; }
Property Value
Type | Description |
---|---|
int |
targetMaterial
Gets the material selected in the UI.
Declaration
public Material targetMaterial { get; }
Property Value
Type | Description |
---|---|
Material |
Methods
Randomize()
Randomizes the shader properties specified in propertiesToRandomize
Declaration
public void Randomize()