Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: tbrewerart on August 06, 2013, 07:57:50 AM

Title: UIButton.collider disabled
Post by: tbrewerart on August 06, 2013, 07:57:50 AM
I’m making a level unlock system using UIButton with the box collider disabled.  I am having trouble using NGUI Tools to enable them.  Consequently, I am using the above Unity code with mixed results.

I simply want to activate the box collider on the UIButton, enabling it and restoring its color. Am I using SetActiveChildren appropriately?
Is there a better way?

Thank you for any help you might offer.

  1. int n = 0;
  2.                 for(int i=0; i<maxLevels; i++)
  3.                 {                                              
  4.                                 if(n <= Misc.getMaxLevel())
  5.                                 {
  6.                                         //NGUITools.SetActiveChildren(planetButton[n], true);
  7.                                         planetButton[n].collider.enabled = true;
  8.                                                
  9.                                                 Misc.setStartSpawnerIndex(0);
  10.                                                 Misc.setStartRound(1);
  11.                                                                                        
  12.                                 }else{
  13.                                         //NGUITools.SetActiveChildren(planetButton[n], false);
  14.                                           planetButton[n].collider.enabled = false;                                    
  15.                                 }
  16.                                 n++;
  17.                 }
  18.  
Title: Re: UIButton.collider disabled
Post by: ArenMook on August 07, 2013, 05:39:02 AM
UIButton.isEnabled is for that.