- Home /
Screen Orientation debug.Log
im trying to make change in my recttransform when the screen of the android became portrait or landscape, but the code just read the screenrotation portrait, the other never work. i dont know why
if (Screen.orientation == ScreenOrientation.Portrait) { rectTransform.anchoredPosition = new Vector2(0, 50); rectTransform.sizeDelta = new Vector2(800, 100); }
if(Screen.orientation == ScreenOrientation.Landscape)
{
rectTransform.anchoredPosition = new Vector2(0, 33);
rectTransform.sizeDelta = new Vector2(800, 75);
}
}
Comment