Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: wallabie on June 11, 2014, 01:30:27 PM

Title: Bug - Toggle optionCanBeNone cannot be set from the inspector.
Post by: wallabie on June 11, 2014, 01:30:27 PM
UIToggle's optionCanBeNone cannot be set from the inspector.

I have a various prefabs with toggles on them and would like to be able to set this property in the inspector. 
Title: Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
Post by: ArenMook on June 12, 2014, 02:16:52 AM
I'll add it for the next update. Meanwhile you can add it yourself by modifying UIToggleInspector.cs and adding these 3 lines after line 32:
  1.                 EditorGUI.BeginDisabledGroup(sp.intValue == 0);
  2.                 NGUIEditorTools.DrawProperty("  State of 'None'", serializedObject, "optionCanBeNone");
  3.                 EditorGUI.EndDisabledGroup();
Title: Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
Post by: wallabie on June 12, 2014, 01:41:10 PM
I'm getting:

Assets/NGUI/Scripts/Editor/UIToggleInspector.cs(34,46): error CS0103: The name `sp' does not exist in the current context
Title: Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
Post by: ArenMook on June 13, 2014, 03:55:42 AM
'sp comes from "Group:
  1. SerializedProperty sp = NGUIEditorTools.DrawProperty("Group", serializedObject, "group", GUILayout.Width(120f));