static bool Draw(string label, BoolOption option, bool enabled = true, GUIStyle style = null)
        {
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_3_5
            EditorGUIUtility.LookLikeControls(label == null ? 35f : labelWidth);
#else
            EditorGUIUtility.labelWidth = label == null ? 35f : labelWidth;
#endif
            var old = GUI.enabled;
            if (!enabled)
            {
                GUI.enabled = false;
            }
            if (style != null)
            {
                option.Value = EditorGUILayout.Toggle(label, option.Value, style, noLayoutOptions);
            }
            else
            {
                option.Value = EditorGUILayout.Toggle(label, option.Value, noLayoutOptions);
            }
            if (!enabled)
            {
                GUI.enabled = old;
            }
            return(option);
        }
 static void Draw2(string label, BoolOption option1, BoolOption option2)
 {
     GUILayout.BeginHorizontal(noLayoutOptions);
     Draw(label, option1);
     Draw(null, option2);
     GUILayout.EndHorizontal();
 }
Exemple #3
0
	static bool Draw(string label, BoolOption option, bool enabled = true, GUIStyle style = null)
	{
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_3_5
		EditorGUIUtility.LookLikeControls(label == null ? 35f : 200f);
#else
		EditorGUIUtility.labelWidth = label == null ? 35f : 200f;
#endif
		if (enabled)
		{
			if (style != null)
				option.Value = EditorGUILayout.Toggle(label, option.Value, style);
			else
				option.Value = EditorGUILayout.Toggle(label, option.Value);
		}
		else
		{
			var old = GUI.enabled;
			GUI.enabled = false;
			if (style != null)
				option.Value = EditorGUILayout.Toggle(label, option.Value, style);
			else
				option.Value = EditorGUILayout.Toggle(label, option.Value);
			GUI.enabled = old;
		}
		return option;
	}
Exemple #4
0
	static void Draw2(string label, BoolOption option1, BoolOption option2)
	{
		GUILayout.BeginHorizontal();
		Draw(label, option1);
		Draw(null, option2);
		GUILayout.EndHorizontal();
	}