Welcome,
Guest
. Please
login
or
register
.
May 03, 2026, 03:45:01 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
NGUI Interface disappear after call NGUITool.Destroy
« previous
next »
Print
Pages: [
1
]
Author
Topic: NGUI Interface disappear after call NGUITool.Destroy (Read 2397 times)
seahorsevn
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 1
NGUI Interface disappear after call NGUITool.Destroy
«
on:
February 17, 2014, 10:52:57 AM »
Hi,
I'm working on a game for Window Phone. I have HUD for whole game and one message box made by NGUI Widget and I put message box into prefab. When player active an event I show the message box and destroy it with NGUITools.Destroy, but all HUD elements disappear and only reappear when player touch on the button region. I don't want the HUD disappear, please help me! Thank you!
This is my code
public
void
ShowMessageBox
(
string
content
)
{
Transform anchor_center
=
transform
.
FindChild
(
"anchor_center"
)
;
NGUITools
.
AddChild
(
anchor_center
.
gameObject
,prefabMessageBox
)
;
Transform dialog_frame
=
anchor_center
.
FindChild
(
"prefab_msgbox(Clone)"
)
.
FindChild
(
"Panel"
)
;
UILabel pDialogMessage
=
(
UILabel
)
dialog_frame
.
FindChild
(
"dialog_msg"
)
.
GetComponent
<
UILabel
>
(
)
;
pDialogMessage
.
text
=
content
;
cl_ActionButton acceptButton
=
(
cl_ActionButton
)
anchor_center
.
GetComponentInChildren
<
cl_ActionButton
>
(
)
;
acceptButton
.
ButtonOnClickEvent
+=
new
delegateButtonOnClick
(
m_pDropletManager
.
buttonOnClick
)
;
}
public
void
HideMessageBox
(
)
{
NGUITools
.
Destroy
(
transform
.
FindChild
(
"anchor_center"
)
.
FindChild
(
"prefab_msgbox(Clone)"
)
.
gameObject
)
;
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: NGUI Interface disappear after call NGUITool.Destroy
«
Reply #1 on:
February 17, 2014, 12:09:12 PM »
What?
If you destroy something, it goes away. If you don't want it to go away, don't destroy it.
Also... finding stuff by name is a terrible practice that will bite you in the ass. Keep that in mind.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
NGUI Interface disappear after call NGUITool.Destroy