Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - seahorsevn

Pages: [1]
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

  1. public void ShowMessageBox(string content)
  2.         {
  3.  
  4.                
  5.                         Transform anchor_center = transform.FindChild("anchor_center");
  6.                         NGUITools.AddChild(anchor_center.gameObject,prefabMessageBox);
  7.                         Transform dialog_frame = anchor_center.FindChild("prefab_msgbox(Clone)").FindChild("Panel");
  8.                         UILabel pDialogMessage = (UILabel)dialog_frame.FindChild("dialog_msg").GetComponent<UILabel>();
  9.                         pDialogMessage.text = content;
  10.                         cl_ActionButton acceptButton = (cl_ActionButton)anchor_center.GetComponentInChildren<cl_ActionButton>();
  11.                         acceptButton.ButtonOnClickEvent += new delegateButtonOnClick(m_pDropletManager.buttonOnClick);
  12.                        
  13.                
  14.         }
  15.         public void HideMessageBox()
  16.         {
  17.                 NGUITools.Destroy(transform.FindChild("anchor_center").FindChild("prefab_msgbox(Clone)").gameObject);
  18.         }

Pages: [1]