1
NGUI 3 Support / Re: Refreshing the UIButton state based on collider active/inactive?
« on: November 29, 2014, 07:29:00 PM »
Ah, sorry. I posted this right before noticing something I hadn't seen before. Solution:
My script now looks like this:
Part that solved it is the 'public UIButton button;' and the 'button.state = UIButtonColor.State.Normal;'
Hope others with this issue can see how easy it is to do, sorry for the trouble!
My script now looks like this:
- using UnityEngine;
- using System.Collections;
- public class UpdateButtonToggleColliders : MonoBehaviour {
- public Collider[] onColliders;
- public Collider[] offColliders;
- public UIButton button;
- void OnClick () {
- foreach (Collider collider in onColliders) {
- collider.enabled = true;
- }
- foreach (Collider collider in offColliders) {
- collider.enabled = false;
- }
- button.state = UIButtonColor.State.Normal;
- }
- }
Part that solved it is the 'public UIButton button;' and the 'button.state = UIButtonColor.State.Normal;'
Hope others with this issue can see how easy it is to do, sorry for the trouble!