Beispiel #1
0
 public void Initialize()
 {
     targetTransform = GetComponent <RectTransform>();
     canvasScaler    = GetComponentInParent <CanvasScalerExt>();
     mainCamera      = Camera.main;
     if (mainCamera == null)
     {
         throw new InvalidOperationException("The scene has not been configured correctly for the CameraViewportAdjuster. No main camera was found.");
     }
 }
Beispiel #2
0
 private void Start()
 {
     canvasScalerExt = GetComponentInParent <CanvasScalerExt>();
     if (canvasScalerExt == null)
     {
     }
     if (canvasScalerExt != null)
     {
         previousMatchWidthOrHeightValue    = canvasScalerExt.matchWidthOrHeight;
         canvasScalerExt.matchWidthOrHeight = OverrideMatchWidthOrHeightValue;
     }
 }
 protected void showPopup(GameObject popup, bool destroyPopupOnBackPressed = false, bool scaleToFit = true, string accessibilityTitleToken = null)
 {
     if (!scaleToFit)
     {
         CanvasScalerExt component = GetComponent <CanvasScalerExt>();
         if (component != null)
         {
             component.enabled = false;
         }
     }
     popup.transform.SetParent(base.transform, worldPositionStays: false);
     popup.SetActive(value: true);
     if (destroyPopupOnBackPressed)
     {
         popup.gameObject.AddComponent <DestroyPopupOnBackPressed>();
     }
     playAccessibilityTitle(accessibilityTitleToken);
 }
 private void Start()
 {
     scaler = GetComponentInParent <CanvasScalerExt>();
     Service.Get <EventDispatcher>().AddListener <AccessibilityEvents.AccessibilityScaleModifierRemoved>(onAccessibilityModifierRemoved);
     modifyCanvasAccessibilityScale();
 }