static void CreatePanel(MenuCommand menuCommand) { GameObject m = new GameObject("MenuPanel"); GameObjectUtility.SetParentAndAlign(m, menuCommand.context as GameObject); m.AddComponent <Image>(); GUIutil.matchObjSizeWithParent(m, menuCommand.context as GameObject); Animator anim = m.AddComponent <Animator>(); doAnimAndSleep doanim = m.AddComponent <doAnimAndSleep>(); m.AddComponent <PanelInfo>(); doanim.anim = anim; doanim.animTrigger = "menuOut"; doanim.delay = 0.7f; }
public void hidePanel(string panelName, bool animate = false, bool dialog = false) { if (animate) { doAnimAndSleep anim = returnPanel(panelName, dialog).GetComponent <doAnimAndSleep>(); if (anim != null) { anim.doAnim(); } else { setPanel(panelName, false, false); } } else { setPanel(panelName, false, false); } }