Version: 2020.2

Shader.GetPropertyDefaultFloatValue

切换到手册
public float GetPropertyDefaultFloatValue (int propertyIndex);

参数

propertyIndex 着色器属性的索引。

描述

返回指定索引处的着色器属性的默认浮点值。

着色器属性声明块会指定默认值。

如果 Unity 在指定索引处找不到属性,该函数将抛出 /ArgumentOutOfRangeException/。 如果属性类型不是 Float 或 Range,该函数将抛出 /ArgumentException/。