void GUIOrientationManger_OnDeviceOrientationChanged(GUILayouterRotationType rt) { if (this.IsNull()) { GUIOrientationManger.OnDeviceOrientationChanged -= GUIOrientationManger_OnDeviceOrientationChanged; return; } if ((rotationType != GUILayouterRotationType.Both)) { bool isActive = (rotationType == rt); gameObject.SetActive(isActive); } ResetLayouter(); if (isActiveAndEnabled) { StartCoroutine(CoroutineInitialize()); } else { isDirty = true; } }
public void RotateToPortrait() { int height = SizeHelperSettings.Instance.baseHeight; int width = SizeHelperSettings.Instance.baseWidth; SizeHelperSettings.Instance.baseWidth = height > width ? width : height; SizeHelperSettings.Instance.baseHeight = height > width ? height : width; currentRotationType = GUILayouterRotationType.Portrait; if (OnDeviceOrientationChanged != null) { OnDeviceOrientationChanged(currentRotationType); } }