Author Topic: Add a function to Toggle (groop N - state isNone)  (Read 2595 times)

outgoing

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Add a function to Toggle (groop N - state isNone)
« on: December 11, 2013, 02:27:27 AM »
Could you add a toggle can disable it if a group of 1 or more.
My implementation

UIToggle.cs
-----------
  1. public bool isNone;
  2. public bool value
  3.         {
  4.                 get { return mIsActive; }
  5.                 set { if (group == 0 || value || optionCanBeNone || !mStarted||isNone ) Set(value);}
  6.         }
  7.  

UIToggleInspector.cs
----------
  1. public override void OnInspectorGUI ()
  2.         {
  3. .....
  4.              NGUIEditorTools.DrawProperty("Starting State", serializedObject, "startsActive");
  5.              NGUIEditorTools.SetLabelWidth(100f);
  6.              NGUIEditorTools.DrawProperty("IsNone", serializedObject, "isNone");
  7.              NGUIEditorTools.SetLabelWidth(80f);
  8. ......
  9.        }
  10.  

Сan be written is not entirely correct, but like works  :)

Sorry for my English, I use a translator
« Last Edit: December 18, 2013, 08:39:53 AM by outgoing »