Ejemplo n.º 1
0
 public static void Hide <T>(System.Action onFinishHiding = null) where T : UILayer
 {
     if (registeredUI.ContainsKey(typeof(T)))
     {
         if (displayedUILayers.Contains(registeredUI[typeof(T)]))
         {
             UILayer layer = registeredUI[typeof(T)];
             layer.Hide(() => {
                 layer.gameObject.SetActive(false);
                 layer.OnHide();
                 layer.transform.SetAsLastSibling();
                 displayedUILayers.Remove(layer);
                 if (onFinishHiding != null)
                 {
                     onFinishHiding();
                 }
             });
         }
     }
 }