Author Topic: Bug - Toggle optionCanBeNone cannot be set from the inspector.  (Read 1865 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
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. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
« Reply #1 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();

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
« Reply #2 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug - Toggle optionCanBeNone cannot be set from the inspector.
« Reply #3 on: June 13, 2014, 03:55:42 AM »
'sp comes from "Group:
  1. SerializedProperty sp = NGUIEditorTools.DrawProperty("Group", serializedObject, "group", GUILayout.Width(120f));