Author Topic: Deactivated Button Still Visible  (Read 4078 times)

Excrubulent

  • Guest
Deactivated Button Still Visible
« on: April 16, 2012, 10:59:28 PM »
I've made a pause menu in NGUI.  The camera and all the menu objects are in a hierarchy under an object called Menu.  When I want to show/hide the menu, I call SetActiveRecursively on the Menu object.  This works just fine on its own.

I then call a function called RerenderMenu() to display either the Disconnect button, in case we're connected, or the Start Server & Connect to Server buttons in case the player has just disconnected.  This function works by calling SetActiveRecursively on each of the buttons.

Normally, each one of these operations work correctly on their own, but there's a problem that occurs when I try to call them both in the same frame.  If I call Menu.SetActiveRecursively(true) followed by RerenderMenu(), the correct objects are activated and work correctly, but I can still see all the inactive buttons.  The deactivated buttons don't respond to mouse events, but they're still visible.  I can confirm from the hierarchy view, and some debug messages, that the button objects are indeed deactivated.

I can't figure out what it is that's happening that causes the buttons to still appear even when they're deactivated.

I'm using Unity 3.5.1 with NGUI 1.68b.  Let me know if you need more information.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Deactivated Button Still Visible
« Reply #1 on: April 16, 2012, 11:01:07 PM »
1.68 isn't supported. You need to update to to the latest, which is currently 2.0.1b.

Excrubulent

  • Guest
Re: Deactivated Button Still Visible
« Reply #2 on: April 16, 2012, 11:07:00 PM »
Fast response!  Will do, thanks.

Excrubulent

  • Guest
Re: Deactivated Button Still Visible
« Reply #3 on: April 16, 2012, 11:25:07 PM »
The only problem is that I'm using the free trial version of NGUI, and that appears to be version 1.68b.  I can't get 2.0.1.

EDIT:  I should mention that I tried re-downloading from the trial download link, but that was still 1.68b.
« Last Edit: April 16, 2012, 11:27:32 PM by Excrubulent »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Deactivated Button Still Visible
« Reply #4 on: April 16, 2012, 11:28:51 PM »
Yeah that'd be a problem. The free version of NGUI is 2 months old and there have been countless changes and fixes since then. The free version is meant to be a preview of what NGUI is capable of -- a snapshot of functionality at the time it was created.