UnityEditor.EditorGUILayout.GetToggleRect C# (CSharp) Méthode

GetToggleRect() static private méthode

static private GetToggleRect ( bool hasLabel ) : Rect
hasLabel bool
Résultat UnityEngine.Rect
        internal static Rect GetToggleRect(bool hasLabel, params GUILayoutOption[] options)
        {
            float num = 10f - EditorGUIUtility.fieldWidth;
            return GUILayoutUtility.GetRect(!hasLabel ? (EditorGUIUtility.fieldWidth + num) : (kLabelFloatMinW + num), kLabelFloatMaxW + num, 16f, 16f, EditorStyles.numberField, options);
        }

Usage Example

Exemple #1
0
		public bool OnGUILayout(SerializedProperty property, GUIContent label, bool includeChildren, params GUILayoutOption[] options)
		{
			Rect rect;
			if (property.propertyType == SerializedPropertyType.Boolean && this.propertyDrawer == null && (this.m_DecoratorDrawers == null || this.m_DecoratorDrawers.Count == 0))
			{
				rect = EditorGUILayout.GetToggleRect(true, options);
			}
			else
			{
				rect = EditorGUILayout.GetControlRect(EditorGUI.LabelHasContent(label), this.GetHeight(property, label, includeChildren), options);
			}
			EditorGUILayout.s_LastRect = rect;
			return this.OnGUI(rect, property, label, includeChildren);
		}
All Usage Examples Of UnityEditor.EditorGUILayout::GetToggleRect