用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:proceduralmaterial:proceduralmaterial

ProceduralMaterial 程序材质

class in UnityEngine/Inherits from: Material

Description 描述

Class for ProceduralMaterial handling.

程序材质处理的类。

JavaScript:

var floatRangeProperty : String = "Saturation";
var cycleTime : float = 10;
var rend: Renderer;
 
 
function Start() {
	rend = GetComponent.<Renderer>();
}
 
 
function Update () {
	var substance : ProceduralMaterial = rend.sharedMaterial as ProceduralMaterial;
 
	if (substance) {
		// Make the property go up and down over time
		var lerp = Mathf.PingPong (Time.time * 2 / cycleTime, 1);
		substance.SetProceduralFloat (floatRangeProperty, lerp);
		substance.RebuildTextures ();
	}
}

C#:

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();
        }
    }
}

Static Variables 静态变量

isSupportedCheck if ProceduralMaterials are supported on the current platform.
在当前平台上检查是否支持程序材质。
substanceProcessorUsageUsed to specify the Substance engine CPU usage.
使用的指定材料处引擎CPU使用率。

Variables 变量

animationUpdateRateSet or get the update rate in millisecond of the animated substance.
设置或者获取动画材料的更新比率单位毫秒。
cacheSizeSet or get the Procedural cache budget.
设置或者获取程序缓存预留。
isCachedDataAvailableIndicates whether cached data is available for this ProceduralMaterial's textures (only relevant for Cache and DoNothingAndCache loading behaviors).
表明缓存数据是否可以获取关于该程序材质的纹理(仅与缓存和DoNothingAndCache 加载行为相关)。
isFrozenReturns true if FreezeAndReleaseSourceData was called on this ProceduralMaterial.
如果FreezeAndReleaseSourceData 在程序材质中被调用返回true。
isLoadTimeGeneratedShould the ProceduralMaterial be generated at load time?
程序材质是否在加载时被产生?
isProcessingCheck if the ProceduralTextures from this ProceduralMaterial are currently being rebuilt.
检测当前程序材质是否在重建纹理的进程中。
isReadableSet or get the “Readable” flag for a ProceduralMaterial.
设置或者获取程序材质的“可读”标志。
loadingBehaviorGet ProceduralMaterial loading behavior.
获取程序材质的加载行为。
presetSet or get an XML string of “input/value” pairs (setting the preset rebuilds the textures).
设置或者获取XML字符串的“输入/值”对(设置预设重建纹理)。

Public Functions 公共函数

CacheProceduralPropertySpecifies if a named ProceduralProperty should be cached for efficient runtime tweaking.
指定命名的程序属性,为高效运行时调节缓存。
ClearCacheClear the Procedural cache.
清除程序缓存。
FreezeAndReleaseSourceDataRender a ProceduralMaterial immutable and release the underlying data to decrease the memory footprint.
渲染程序材质不可变并释放的基础数据,以减少内存占用。
GetGeneratedTextureThis allows to get a reference to a ProceduralTexture generated by a ProceduralMaterial using its name.
该函数允许你获取程序纹理生成的参数,通过程序材质使用它的名称。
GetGeneratedTexturesGet generated textures.
获取生成纹理数组。
GetProceduralBooleanGet a named Procedural boolean property.
获取一个命名的程序布尔属性。
GetProceduralColorGet a named Procedural color property.
获取一个命名的程序颜色属性。
GetProceduralEnumGet a named Procedural enum property.
获取一个命名的程序枚举属性。
GetProceduralFloatGet a named Procedural float property.
获取一个命名的程序浮点数属性。
GetProceduralPropertyDescriptionsGet an array of descriptions of all the ProceduralProperties this ProceduralMaterial has.
获取这个程序材质所有属性描述的一个数组。
GetProceduralTextureGet a named Procedural texture property.
获取一个命名的程序纹理属性。
GetProceduralVectorGet a named Procedural vector property.
获取一个命名的程序向量属性。
HasProceduralPropertyChecks if the ProceduralMaterial has a ProceduralProperty of a given name.
检测程序材质是否具有给定名称的属性。
IsProceduralPropertyCachedChecks if a named ProceduralProperty is cached for efficient runtime tweaking.
检查一个命名的程序属性是否被缓存,用于高效运行时调节。
IsProceduralPropertyVisibleChecks if a given ProceduralProperty is visible according to the values of this ProceduralMaterial's other ProceduralProperties and to the ProceduralProperty's visibleIf expression.
根据程序材质的其他属性和程序属性的visibleIf表达式检查指定程序属性是否可见。
RebuildTexturesTriggers an asynchronous rebuild of this ProceduralMaterial's dirty textures.
触发该程序材质修改的纹理异步重建。
RebuildTexturesImmediatelyTriggers an immediate (synchronous) rebuild of this ProceduralMaterial's dirty textures.
触发该程序材质的修改的纹理立即(同步)重建。
SetProceduralBooleanSet a named Procedural boolean property.
设置一个命名的程序布尔属性。
SetProceduralColorSet a named Procedural color property.
设置一个命名的程序颜色属性。
SetProceduralEnumSet a named Procedural enum property.
设置一个命名的程序枚举属性。
SetProceduralFloatSet a named Procedural float property.
设置一个命名的程序浮点数属性。
SetProceduralTextureSet a named Procedural texture property.
设置一个命名的程序纹理属性。
SetProceduralVectorSet a named Procedural vector property.
设置一个命名的程序向量属性。

Static Functions 静态函数

StopRebuildsDiscard all the queued ProceduralMaterial rendering operations that have not started yet.
抛弃所有程序材质队列还未开始的渲染操作。
script/unityengine/classes/proceduralmaterial/proceduralmaterial.txt · 最后更改: 2016/08/02 05:32 (外部编辑)