public static WindowPanelBuilder Create(string title) { title = TextHelper.Cap(title); GameObject act = Instantiate(UIElements.Get().panelWindow, GameObject.Find("WindowsMgmt").transform); act.name = title; act.transform.GetComponentInChildren <Text>().text = title; act.GetComponent <WindowPanelBuilder>().panel = PanelBuilder.Create(act.transform.GetChild(0).GetChild(2).transform); return(act.GetComponent <WindowPanelBuilder>()); }
private void ShowDetail() { if (infoPanel.transform.childCount > 0) { UIHelper.ClearChild(infoPanel); } PanelBuilder p = PanelBuilder.Create(infoPanel.transform); selectedElement.ShowDetail(p); p.CalcSize(); NAudio.Play(selectedElement.audioSwitch); }
private void ShowDetail() { if (infoPanel.transform.childCount > 0) { foreach (Transform child in infoPanel.transform) { Destroy(child.gameObject); } ; } PanelBuilder p = PanelBuilder.Create(infoPanel.transform); selectedElement.ShowDetail(p); p.CalcSize(); NAudio.Play(selectedElement.audioSwitch); }