Welcome,
Guest
. Please
login
or
register
.
May 01, 2026, 12:31:14 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
NGUITools.SetActive not updating after made true
« previous
next »
Print
Pages: [
1
]
Author
Topic: NGUITools.SetActive not updating after made true (Read 6946 times)
tinyutopia
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 15
NGUITools.SetActive not updating after made true
«
on:
June 16, 2012, 05:31:16 PM »
I have an array of GameObjects that I disable in start with
void
setAllItemsInvisable
(
)
{
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
for
(
var
j
=
0
;
j
<
7
;
j
++
)
{
NGUITools
.
SetActive
(
buttonViewableArray
[
i, j
]
,
false
)
;
}
}
}
which works well enough. Then I make the GameObject active with
public
void
MakeButttonVisible
(
int
category,
int
item
)
{
NGUITools
.
SetActive
(
buttonViewableArray
[
category, item
]
,
true
)
;
}
I can see that the GameObject is active, but it does not update in the game view until I click on it and move it around. Is there somewhere else that I should be putting the SetActive method so that it will happen when it's called and not require the playing around to get it to appear?
Logged
Nicki
Global Moderator
Hero Member
Thank You
-Given: 33
-Receive: 141
Posts: 1,768
Re: NGUITools.SetActive not updating after made true
«
Reply #1 on:
June 16, 2012, 07:31:47 PM »
If it's your UIpanel that's not updating, you can try to call Refresh() on it. It's hard to say, because you're not giving us much to go on.
Is it in a draggable panel? Is it in table? Grid? How does the hierarchy look?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: NGUITools.SetActive not updating after made true
«
Reply #2 on:
June 17, 2012, 06:51:15 PM »
Another question to add -- is the panel marked as static (not the game object, the option on the UIPanel).
Logged
tinyutopia
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 15
Re: NGUITools.SetActive not updating after made true
«
Reply #3 on:
June 19, 2012, 07:07:41 PM »
Thanks for the responses guys.
ArenMook had the solution, I had static checked in my UIPanel. Unchecking it allowed the panel to update.
So the hierarchy is UI Root (2D) > UIPanel > UIDraggablePanel > UIGrid > UIDragPanelContents
Thanks again.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
NGUITools.SetActive not updating after made true