本文整理匯總了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();
}
}