Class for ProceduralMaterial handling.
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public string floatRangeProperty = "Saturation"; public float cycleTime = 10; public Renderer rend; void Start() { rend = GetComponent<Renderer>(); } void Update() { ProceduralMaterial substance = rend.sharedMaterial as ProceduralMaterial; if (substance) { float lerp = Mathf.PingPong(Time.time * 2 / cycleTime, 1); substance.SetProceduralFloat(floatRangeProperty, lerp); substance.RebuildTextures(); } } }
isSupported | Check if ProceduralMaterials are supported on the current platform. |
substanceProcessorUsage | Used to specify the Substance engine CPU usage. |
animationUpdateRate | Set or get the update rate in millisecond of the animated substance. |
cacheSize | Set or get the Procedural cache budget. |
isCachedDataAvailable | Indicates whether cached data is available for this ProceduralMaterial's textures (only relevant for Cache and DoNothingAndCache loading behaviors). |
isFrozen | Returns true if FreezeAndReleaseSourceData was called on this ProceduralMaterial. |
isLoadTimeGenerated | Should the ProceduralMaterial be generated at load time? |
isProcessing | Check if the ProceduralTextures from this ProceduralMaterial are currently being rebuilt. |
isReadable | Set or get the "Readable" flag for a ProceduralMaterial. |
loadingBehavior | Get ProceduralMaterial loading behavior. |
preset | Set or get an XML string of "input/value" pairs (setting the preset rebuilds the textures). |
CacheProceduralProperty | Specifies if a named ProceduralProperty should be cached for efficient runtime tweaking. |
ClearCache | Clear the Procedural cache. |
FreezeAndReleaseSourceData | Render a ProceduralMaterial immutable and release the underlying data to decrease the memory footprint. |
GetGeneratedTexture | This allows to get a reference to a ProceduralTexture generated by a ProceduralMaterial using its name. |
GetGeneratedTextures | Get generated textures. |
GetProceduralBoolean | Get a named Procedural boolean property. |
GetProceduralColor | Get a named Procedural color property. |
GetProceduralEnum | Get a named Procedural enum property. |
GetProceduralFloat | Get a named Procedural float property. |
GetProceduralPropertyDescriptions | Get an array of descriptions of all the ProceduralProperties this ProceduralMaterial has. |
GetProceduralTexture | Get a named Procedural texture property. |
GetProceduralVector | Get a named Procedural vector property. |
HasProceduralProperty | Checks if the ProceduralMaterial has a ProceduralProperty of a given name. |
IsProceduralPropertyCached | Checks if a named ProceduralProperty is cached for efficient runtime tweaking. |
IsProceduralPropertyVisible | Checks if a given ProceduralProperty is visible according to the values of this ProceduralMaterial's other ProceduralProperties and to the ProceduralProperty's visibleIf expression. |
RebuildTextures | Triggers an asynchronous rebuild of this ProceduralMaterial's dirty textures. |
RebuildTexturesImmediately | Triggers an immediate (synchronous) rebuild of this ProceduralMaterial's dirty textures. |
SetProceduralBoolean | Set a named Procedural boolean property. |
SetProceduralColor | Set a named Procedural color property. |
SetProceduralEnum | Set a named Procedural enum property. |
SetProceduralFloat | Set a named Procedural float property. |
SetProceduralTexture | Set a named Procedural texture property. |
SetProceduralVector | Set a named Procedural vector property. |
StopRebuilds | Discard all the queued ProceduralMaterial rendering operations that have not started yet. |
color | Основной цвет материала. |
globalIlluminationFlags | Defines how the material should interact with lightmaps and lightprobes. |
mainTexture | Текстура материала. |
mainTextureOffset | Отступ основной текстуры. |
mainTextureScale | Масштабирование основной текстуры. |
passCount | How many passes are in this material (Read Only). |
renderQueue | Render queue of this material. |
shader | The shader used by the material. |
shaderKeywords | Additional shader keywords set by this material. |
hideFlags | Should the object be hidden, saved with the scene or modifiable by the user? |
name | The name of the object. |
CopyPropertiesFromMaterial | Копирует свойства с другого материала в данный материал. |
DisableKeyword | "Отзывает" ключевое слово шейдера. |
EnableKeyword | Устанавливает ключевое слово шейдера, которое активируется данным материалом. |
FindPass | Returns the index of the pass passName. |
GetColor | Получает имя значения цвета. |
GetColorArray | Get a named color array. |
GetFloat | Получает именованное float значение. |
GetFloatArray | Get a named float array. |
GetInt | Получает именованное integer значение. |
GetMatrix | Получает именованное значение матрицы из шейдера. |
GetMatrixArray | Get a named matrix array. |
GetPassName | Returns the name of the shader pass at index pass. |
GetTag | Получает тэг шейдера материала. |
GetTexture | Получает именованную текстуру. |
GetTextureOffset | Получает размещение смещения текстуры propertyName. |
GetTextureScale | Получает размещение масштабирования текстуры propertyName. |
GetVector | Получает значение именованного вектора. |
GetVectorArray | Get a named vector array. |
HasProperty | Проверяет, имеет ли шейдер материала свойство по заданному имени. |
IsKeywordEnabled | Устанавливает ключевое слово шейдера, которое активируется данным материалом. |
Lerp | Интерполирует свойства между двумя материалами. |
SetBuffer | Set a named ComputeBuffer value. |
SetColor | Устанавливает именованное значение цвета. |
SetColorArray | Set a color array property. |
SetFloat | Устанавливает именованное float значение. |
SetFloatArray | Set a float array property. |
SetInt | Устанавливает именованное integer значение. |
SetMatrix | Устанавливает именованную матрицу для шейдера. |
SetMatrixArray | Set a matrix array property. |
SetOverrideTag | Устанавливает ключевое слово шейдера, которое активируется данным материалом. |
SetPass | Активирует, учитывая pass для визуализации. |
SetTexture | Устанавливает именованную текстуру. |
SetTextureOffset | Устанавливает перемещение отступа текстуры propertyName. |
SetTextureScale | Устанавливает перемещение масштабирования текстуры propertyName. |
SetVector | Устанавливает именованное значение вектора. |
SetVectorArray | Устанавливает именованное значение вектора. |
GetInstanceID | Returns the instance id of the object. |
ToString | Returns the name of the game object. |
Destroy | Удаляет GameObject, Component или Asset. |
DestroyImmediate | Destroys the object obj immediately. |
DontDestroyOnLoad | Makes the object target not be destroyed automatically when loading a new scene. |
FindObjectOfType | Returns the first active loaded object of Type type. |
FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |