Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Fireball14

Pages: 1 [2]
16
NGUI 3 Support / Re: MissingReferenceException inside NGUI
« on: July 01, 2014, 10:26:09 AM »
Ok traced this error to this code:
Label.gameObject is turned off on Start.
  1.     void Awake()
  2.     {
  3.         BattleMain.OnEquationChange += OnOnEquationChange; //<- Activates while Label.gameObject is not active, so i think this is what causing problem. Still need to do some testing.
  4.     }
  5.  
  6.     private void OnOnEquationChange()
  7.     {
  8.         Label.text = "2+2";
  9.     }
  10.  

17
NGUI 3 Support / MissingReferenceException inside NGUI
« on: July 01, 2014, 09:46:21 AM »
MissingReferenceException: The object of type 'UILabel' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.get_transform () (at C:/BuildAgent/work/aeedb04a1292f85a/artifacts/EditorGenerated/UnityEngineComponent.cs:20)
UIRect.get_cachedTransform () (at Assets/NGUI/Scripts/Internal/UIRect.cs:196)
UIRect.get_parent () (at Assets/NGUI/Scripts/Internal/UIRect.cs:239)

I get this randomly after updating to 3.6.6
Edit:
(and on 3.6.4(did not get it yet on 3.6.6)).
Also i get (randomly) similar errors on UItween components.(il add trace when next time i get this on UItween)

18
NGUI 3 Support / Re: collider missed events
« on: June 20, 2014, 07:34:57 AM »
Use event mask on UICamera to ignore some coliders by Layers when you dont need them.

19
Use 0 Border on left and right of your 9 sliced sprite.

On side note you can always use script that will change Alpha value on UISlider to 0 while   slider value 0.

But still i think, if we could have bool that will turn off foreground if value is 0, than it would be a big help.

20
Ok im really sorry. You right!
I forgot to mention i needed to reset toggle grope to initial state.
So i made this script on parent panel:
  1. public Toggle1;
  2. void OnEnable()
  3. {
  4.      Toggle1.value = true; // <- Thats where both are on.
  5. }
  6.  
Because there is no native way i could find to do it.
So yeh... basically its my own fault. But it would be nice if i could have a method to reset groupe as i need.

21
This is a bug report.

Steps to replicate:

1. AccordionSV with 2 item.
2. Item 1  is a Horizontal SV with 3 buttons with toggle number of 10
3. Item 2  is a Horizontal SV with 3 buttons with toggle number of 10
4. Click button 1 in accordion Item 1.
5. Collapse accordion Item 1.
6. Open accordion Item 2.
7. Click button 1 in Item 2.
8. Open accordion item1. 
9. Both buttons are highlighted instead of only one button.

Just fought this bug yesterday. This is happening, because you need to reset Toggle groupe to initial state before you disable your items.
How to replicate this bug:

Toggle groupe contains 2 items - Toggle1 and Toggle2.
Both toggles are in group 1.
Toggle 1 has Starting state bool active.

When panel with troggles goes active, Toggle1 is checked, Toggle2 is not.
If you select Toggle2 by clicking on it. Then Toggle2 goes checked, and Toggle1 is not.
To this point everything goes normal. But then:
If you deactivate panel gameObject, and then you activate it again, you will have both  toggles checked.

To fight it i just use on toggle root panel this script.
  1. OnDisable()
  2. {
  3.         foreach (var toggle in GetComponentsInChildren<UIToggle>())
  4.         {
  5.             toggle.value = toggle.startsActive;
  6.         }
  7. }
  8.  

22
NGUI 3 Support / Re: UIToggle Not Changing value
« on: June 10, 2014, 09:52:51 AM »
Remember if you want some option in toogle groupe to be always active, then specify what toggle shoud be active if all of them go off.
  1. public bool turnOn;
  2.    
  3.     void OnEnable()
  4.     {
  5.         GetComponent<UIToggle>().optionCanBeNone = true;  // <- This is your problem!
  6.         turnOn = GetComponent<UIToggle>().startsActive;
  7.     }
  8.     void Update()
  9.     {
  10.         GetComponent<UIToggle>().value = turnOn;
  11.     }
  12.  

Also remember to sendout status change on UIToggle value change event.
But as i see it, its a lot more easy to use toggle with out any other scripts and sendout   c# event on value changed or use NGUI EventDelegate system.

23
NGUI 3 Support / Re: Scrollbar Foreground image scaling
« on: April 02, 2014, 09:09:16 AM »
Thx a LOT! This is really what i need! I wish this was standard feature of NGUI!

Pages: 1 [2]