Author Topic: Possible bug in UIToggleInspector: exposing optionCanBeNone  (Read 2363 times)

strangeioc

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Possible bug in UIToggleInspector: exposing optionCanBeNone
« on: January 27, 2014, 09:40:15 PM »
I've noticed that I can't (can no longer?) set UIToggle.optionCanBeNone in the associated inspector, which seems wrong to me.

I've altered my local UIToggleInspector to:

  1.       NGUIEditorTools.DrawProperty("Starting State", serializedObject, "startsActive");
  2.       //New line here.......
  3.       NGUIEditorTools.DrawProperty("Option Can Be None", serializedObject, "optionCanBeNone");
  4.       NGUIEditorTools.SetLabelWidth(80f);
  5.  

Maybe I'm not understanding why you're not exposing optionCanBeNone, but it feels like an accidental omission. Anyway, just pointing it out.

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Possible bug in UIToggleInspector: exposing optionCanBeNone
« Reply #1 on: January 28, 2014, 09:29:35 AM »
This happened ~4 months ago, and you are the first one to mention something. I basically saw little use for that option, which is why I removed it from the inspector. Those that need it, such as yourself, can still use it either via code or by re-adding the property as you have.

strangeioc

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Possible bug in UIToggleInspector: exposing optionCanBeNone
« Reply #2 on: January 28, 2014, 01:08:23 PM »
Fair enough, though isn't this an intrinsic requirement for any toggleable boolean switch (i.e., I want to toggle a behavior like mute/unmute, rather than use it as part of a radio set). Maybe there's a better way to accomplish this?

BeShifty

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 7
  • Posts: 52
    • View Profile
Re: Possible bug in UIToggleInspector: exposing optionCanBeNone
« Reply #3 on: January 28, 2014, 01:32:11 PM »
If the group id is 0 (no group), it will ignore optionCanBeNone entirely, since that option only pertains to radio groups.

strangeioc

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Possible bug in UIToggleInspector: exposing optionCanBeNone
« Reply #4 on: January 28, 2014, 01:37:34 PM »
If the group id is 0 (no group), it will ignore optionCanBeNone entirely, since that option only pertains to radio groups.

Ah, ok. That makes sense. Thanks.