Exemplo n.º 1
0
 public static NotchUtils Instance()
 {
     if (_instance == null)
     {
         GameObject obj = new GameObject("NotchUtils");
         _instance = obj.AddComponent <NotchUtils>();
         DontDestroyOnLoad(obj);
     }
     return(_instance);
 }
Exemplo n.º 2
0
 IEnumerator Adaptor()
 {
     while (!NotchUtils.Instance().IsInit)
     {
         yield return(null);
     }
     if (NotchUtils.Instance().HasNotch)
     {
         text.text = NotchUtils.Instance().NotchSize.ToString();
     }
 }
Exemplo n.º 3
0
 IEnumerator Adaptor()
 {
     while (!NotchUtils.Instance().IsInit)
     {
         yield return(null);
     }
     if (NotchUtils.Instance().HasNotch)
     {
         Rect rect = NotchUtils.Instance().GetSafeRect();
         if (rectTransform == null)
         {
             rectTransform = GetComponent <RectTransform>();
         }
         rectTransform.anchorMin = rect.min;
         rectTransform.anchorMax = rect.size;
     }
 }