From ddcbd1f8e21e779c72296827ef7e26da9e18ff53 Mon Sep 17 00:00:00 2001 From: Neil Sarkar Date: Sun, 26 Jul 2020 13:25:05 -0700 Subject: [PATCH] Calculate position dynamically --- Runtime/Navigation/VioletButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Navigation/VioletButton.cs b/Runtime/Navigation/VioletButton.cs index b3f78ac..be12a46 100644 --- a/Runtime/Navigation/VioletButton.cs +++ b/Runtime/Navigation/VioletButton.cs @@ -46,7 +46,7 @@ void OnGUI() { if(Event.current.type != EventType.MouseDown) { return; } var mousePosition = Event.current.mousePosition; - mousePosition.y = 768 - mousePosition.y; + mousePosition.y = UnityEngine.Screen.height - mousePosition.y; var rect = GetComponent().rect; var topLeft = transform.position + new Vector3(rect.xMin, rect.yMin, 0);