Beispiel #1
0
 public static T ShowModal <T>(System.Action showingDelegate = null) where T : UILayer
 {
     if (registeredUI.ContainsKey(typeof(T)))
     {
         UILayer layer = registeredUI[typeof(T)];
         if (!displayedUILayers.Contains(layer))
         {
             layer.gameObject.SetActive(true);
             displayedUILayers.Add(layer);
             layer.Show(() => {
                 if (showingDelegate != null)
                 {
                     showingDelegate();
                 }
                 layer.OnShow();
             });
         }
         else
         {
             layer.Show(() => {
                 if (showingDelegate != null)
                 {
                     showingDelegate();
                 }
                 layer.OnShow();
             });
         }
         SortLayers();
         return((T)layer);
     }
     else
     {
         Create <T>();
         return(UILayer.ShowModal <T>(showingDelegate));
     }
 }