1
NGUI 3 Support / 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
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>();
- }
- public void HideMessageBox()
- {
- NGUITools.Destroy(transform.FindChild("anchor_center").FindChild("prefab_msgbox(Clone)").gameObject);
- }
