本文整理匯總了C#中UnityEditor.SerializedProperty.GetLayerMaskSelectedIndex方法的典型用法代碼示例。如果您正苦於以下問題:C# SerializedProperty.GetLayerMaskSelectedIndex方法的具體用法?C# SerializedProperty.GetLayerMaskSelectedIndex怎麽用?C# SerializedProperty.GetLayerMaskSelectedIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEditor.SerializedProperty
的用法示例。
在下文中一共展示了SerializedProperty.GetLayerMaskSelectedIndex方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: LayerMaskField
internal static void LayerMaskField(Rect position, SerializedProperty property, GUIContent label, GUIStyle style)
{
int controlId = GUIUtility.GetControlID(EditorGUI.s_LayerMaskField, EditorGUIUtility.native, position);
position = EditorGUI.PrefixLabel(position, controlId, label);
Event current = Event.current;
if (current.type == EventType.Repaint)
{
if (EditorGUI.showMixedValue)
{
EditorGUI.BeginHandleMixedValueContentColor();
style.Draw(position, EditorGUI.s_MixedValueContent, controlId, false);
EditorGUI.EndHandleMixedValueContentColor();
}
else
style.Draw(position, EditorGUIUtility.TempContent(property.layerMaskStringValue), controlId, false);
}
else
{
if ((current.type != EventType.MouseDown || !position.Contains(current.mousePosition)) && !current.MainActionKeyForControl(controlId))
return;
SerializedProperty property1 = property.serializedObject.FindProperty(property.propertyPath);
EditorUtility.DisplayCustomMenu(position, property.GetLayerMaskNames(), !property.hasMultipleDifferentValues ? property.GetLayerMaskSelectedIndex() : new int[0], new EditorUtility.SelectMenuItemFunction(EditorGUI.SetLayerMaskValueDelegate), (object) property1);
Event.current.Use();
}
}