private void EnsureUIContainer(UIContainer uiConTainer) { if (uiConTainer) { CanvasGroup canvasGroup = uiConTainer.GetComponent <CanvasGroup>(); if (!canvasGroup) { canvasGroup = uiConTainer.gameObject.AddComponent <CanvasGroup>(); } uiConTainer.canvasGroup = canvasGroup; } }
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(); } } }
public override void ResetItemToDefaultState() { UIContainer.GetComponent <Renderer>().material.color = InitialColor; }