void Awake() { //Set the back button keycode on build otherwise it won't work properly #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) backButton = KeyCode.Escape; #endif canvas = GetComponent <Canvas>(); deviceResolutionChange = GetComponent <DeviceResolutionChange>(); if (useDefaultOrientation) { Screen.orientation = defaultOrientation; } if (startIndex > panelEntries.Length - 1) { Debug.LogWarningFormat("Starting panel index {0} is out of bounds!", startIndex); return; } history = new Stack <int>(); if (goToStartIndex) { goToPanel(startIndex); } if (getPanel(currentIndex).includeInHistory) { history.Push(startIndex); } }
void Start() { deviceResolutionChange = GetComponent <DeviceResolutionChange>(); dialogObjectRectTransform = dialogObject.GetComponent <RectTransform>(); cachedDialogObjectAnchorMax = dialogObjectRectTransform.anchorMax; buttonLayoutRectransform = buttonLayout.GetComponent <RectTransform>(); setCustomPrefabs(); deviceResolutionChange.OnOrientationChange.AddListener(onDeviceOrientationChange); deviceResolutionChange.OnResolutionChange.AddListener(onDeviceResolutionChange); }