private void EnsureUIContainer(UIContainer uiConTainer)
 {
     if (uiConTainer)
     {
         CanvasGroup canvasGroup = uiConTainer.GetComponent <CanvasGroup>();
         if (!canvasGroup)
         {
             canvasGroup = uiConTainer.gameObject.AddComponent <CanvasGroup>();
         }
         uiConTainer.canvasGroup = canvasGroup;
     }
 }
Esempio n. 2
0
 private void LateUpdate()
 {
     if (uiScreenRect != null)
     {
         if (uiRect == null || uiRect.size.x == 0)
         {
             uiRect = UIContainer.GetComponent <RectTransform>().rect;
         }
         if (uiScreenRect.size != uiRect.size || uiScreenRect.position != uiRect.position)
         {
             UpdateUIScreenRect();
             CheckDeviceOrientation();
             OnSizeChanged?.Invoke();
         }
     }
 }
Esempio n. 3
0
 public override void ResetItemToDefaultState()
 {
     UIContainer.GetComponent <Renderer>().material.color = InitialColor;
 }