Author Topic: Toggle group not working correctly on Scene Start.  (Read 3599 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Toggle group not working correctly on Scene Start.
« on: April 15, 2014, 11:36:06 AM »
1. Got 3 toggle buttons. Bt1,Bt2,Bt3
2. and 3 content panels. A,B,C
3. The first toggle has "starting state" checked.
4. Activate and Deactivate is set correctly for each toggle.
5. When the scene is initially fired off, content A,B are displayed simultaneously.
6. However, When clicking buttons manually, the contents are enabled/disabled correctly.
7. This problem doesn't occur when there is only 2 buttons and 2 content panels.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Toggle group not working correctly on Scene Start.
« Reply #1 on: April 16, 2014, 10:00:38 AM »
Try adding a Debug.Log statement to UIToggle.cs, around line 151 where it calls the delegate. See where it's called from.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Toggle group not working correctly on Scene Start.
« Reply #2 on: April 16, 2014, 12:41:57 PM »
I put in the debug statement at line 151 and fired up the scene but it did not get called.

Line 151 is in :  if (!Application.isPlaying), which should not fire when the app is playing. 

Edit: found a working configuration which is to leave the Deactivate empty.  Previously for each tab, I would enable the corresponding content and deactivate the other 2 contents. 

So now,  activate the content and leave the deactivate empty for all three tabs and it works.  I'm presuming that the deactivate was meant for other components and should not be the contents belonging to the other toggle in the same toggle set.
« Last Edit: April 16, 2014, 12:51:31 PM by wallabie »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Toggle group not working correctly on Scene Start.
« Reply #3 on: April 17, 2014, 10:48:23 AM »
Yup, that's right. Just set one of them.