From bd8cebaf46e85ec8d93cef791c1ebcb68d8ae620 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 May 2018 14:50:26 +0200 Subject: [PATCH] Fixed screen size in build --- Assets/Scenes/Main.unity | 2 +- Assets/Scripts/FakePointManager.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index eff65c3..2908804 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -235,7 +235,7 @@ Prefab: - target: {fileID: 224261597021104126, guid: 79c2718dd59243e4c90e145349e7dadf, type: 2} propertyPath: m_AnchoredPosition.y - value: 0.000030517578 + value: 0.000061035156 objectReference: {fileID: 0} - target: {fileID: 4679437618935694, guid: 79c2718dd59243e4c90e145349e7dadf, type: 2} propertyPath: m_LocalEulerAnglesHint.y diff --git a/Assets/Scripts/FakePointManager.cs b/Assets/Scripts/FakePointManager.cs index 60cc9c9..d6116ec 100644 --- a/Assets/Scripts/FakePointManager.cs +++ b/Assets/Scripts/FakePointManager.cs @@ -187,14 +187,14 @@ public void Clear() public void ChangeResolution() { - var newWidth = Mathf.Clamp(Width, WidthMin, Screen.width); - var newHeight = Mathf.Clamp(Height, HeightMin, Screen.height); var ratio = Width / Height; + var newWidth = Mathf.Clamp(Width, WidthMin * ratio, Screen.width); + var newHeight = Mathf.Clamp(Height, HeightMin, Screen.height); - if (Height > Width) - Screen.SetResolution(newWidth, newHeight * ratio, false); - else - Screen.SetResolution(newWidth * ratio, newHeight, false); + Screen.SetResolution(newWidth, newHeight, false); + //if (Height < Width) + //else + // Screen.SetResolution(newWidth * ratio, newHeight, false); } public void OnMouseDrag()