示例#1
0
 public T ShowMenu <T>(T prefab) where T : PhxMenuInterface
 {
     if (CurrentMenu != null)
     {
         RemoveMenu(false);
     }
     CurrentMenu = Instantiate(prefab.gameObject).GetComponent <PhxMenuInterface>();
     return((T)CurrentMenu);
 }
示例#2
0
 void RemoveMenu(bool bInvokeEvent)
 {
     if (CurrentMenu != null)
     {
         Type menuType = CurrentMenu.GetType();
         CurrentMenu.Clear();
         Destroy(CurrentMenu.gameObject);
         CurrentMenu = null;
         if (bInvokeEvent)
         {
             OnRemoveMenu?.Invoke(menuType);
         }
     }
 }
示例#3
0
 public bool IsMenuActive(PhxMenuInterface prefab)
 {
     Debug.Assert(prefab != null);
     return(CurrentMenu == null ? false : CurrentMenu.GetType() == prefab.GetType());
 }