本文整理汇总了C#中UnityEditor.MaterialEditor.FloatProperty方法的典型用法代码示例。如果您正苦于以下问题:C# MaterialEditor.FloatProperty方法的具体用法?C# MaterialEditor.FloatProperty怎么用?C# MaterialEditor.FloatProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.MaterialEditor
的用法示例。
在下文中一共展示了MaterialEditor.FloatProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
override public void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor editor) {
bool inactiveFlag = false;
if (!checkNormalmapsUsage(editor.target as Material, label)) return;
if (!checkDetailUsage(editor.target as Material, label)) return;
if (!checkSpecUsage(editor.target as Material, label)) return;
#if UNITY_5
if (prop.name=="unity_SpecCube" || prop.name=="unity_SpecCube1") return;
#endif
if (checkVisible (editor, label, ref inactiveFlag)) {
EditorGUI.BeginDisabledGroup(inactiveFlag);
switch (prop.type) {
case MaterialProperty.PropType.Range: // float ranges
{
editor.RangeProperty(position, prop, label);
break;
}
case MaterialProperty.PropType.Float: // floats
{
editor.FloatProperty(position, prop, label);
break;
}
case MaterialProperty.PropType.Color: // colors
{
editor.ColorProperty(position, prop, label);
break;
}
case MaterialProperty.PropType.Texture: // textures
{
editor.TextureProperty(position, prop, label, texTileOffset);
break;
}
case MaterialProperty.PropType.Vector: // vectors
{
position.x+=12;
position.width-=12;
editor.VectorProperty(position, prop, label);
break;
}
default:
{
GUILayout.Label("Unknown prop type... ("+label+")");
break;
}
}
EditorGUI.EndDisabledGroup();
}
}