diff --git a/Assets/Resources/UI/TutorialView.prefab b/Assets/Resources/UI/TutorialView.prefab index d73c19a..65607f3 100644 --- a/Assets/Resources/UI/TutorialView.prefab +++ b/Assets/Resources/UI/TutorialView.prefab @@ -379,7 +379,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1792505052625370 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -606,6 +606,7 @@ MonoBehaviour: reticuleHighlight: {fileID: 114430674035238108} menuHighlight: {fileID: 114094662748965206} selectHighlight: {fileID: 114425245405885838} + Crosshairs: {fileID: 1991900300183792} --- !u!114 &114339554770605862 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1704,8 +1705,9 @@ RectTransform: - {fileID: 224257449048418606} - {fileID: 224385246327759096} - {fileID: 224882127646750572} + - {fileID: 224543001454646402} m_Father: {fileID: 224386065082169650} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1743,7 +1745,6 @@ RectTransform: - {fileID: 224893231122565744} - {fileID: 224773095307896718} - {fileID: 224336834733934388} - - {fileID: 224543001454646402} - {fileID: 224374825834825260} m_Father: {fileID: 0} m_RootOrder: 0 @@ -1802,8 +1803,8 @@ RectTransform: - {fileID: 224020227865350692} - {fileID: 224770383868184822} - {fileID: 224845810070959288} - m_Father: {fileID: 224386065082169650} - m_RootOrder: 3 + m_Father: {fileID: 224374825834825260} + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} diff --git a/Assets/RothenburgAR/Scripts/UI/ARViewBehaviour.cs b/Assets/RothenburgAR/Scripts/UI/ARViewBehaviour.cs index c660504..decf023 100644 --- a/Assets/RothenburgAR/Scripts/UI/ARViewBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/UI/ARViewBehaviour.cs @@ -12,7 +12,7 @@ namespace RothenburgAR.UI public void Start() { - Crosshairs.SetActive(DisplayManager.Instance.AllowCrosshairControls); + Crosshairs.SetActive(InputManager.Instance.AllowCrosshairControls); } public void DisplayPoiDetails(PoiBehaviour poi, bool animated = true) diff --git a/Assets/RothenburgAR/Scripts/UI/DisplayManager.cs b/Assets/RothenburgAR/Scripts/UI/DisplayManager.cs index 363ac8f..8af6692 100644 --- a/Assets/RothenburgAR/Scripts/UI/DisplayManager.cs +++ b/Assets/RothenburgAR/Scripts/UI/DisplayManager.cs @@ -19,8 +19,7 @@ namespace RothenburgAR.UI public readonly UnityEvent OnOrientationChange = new UnityEvent(); public ScreenOrientation ScreenOrientation; - private static readonly float CrosshairControlsDisplaySizeThreshold = 7f; - public bool AllowCrosshairControls { get; private set; } + public float ScreensizeInInches { get; set; } private Vector2 lastKnownResolution; // Current Resolution private ScreenOrientation orientation; // Current Screen Orientation @@ -47,9 +46,8 @@ namespace RothenburgAR.UI : ScreenOrientation.Landscape; // Screen diagonal in logical inches - var diagonalIn = Mathf.Sqrt(Mathf.Pow(Screen.height, 2) + Mathf.Pow(Screen.width, 2)) / Screen.dpi; - Debug.Log("Screen Diagonal is something like " + diagonalIn + " inches."); - instance.AllowCrosshairControls = diagonalIn >= CrosshairControlsDisplaySizeThreshold; + instance.ScreensizeInInches = Mathf.Sqrt(Mathf.Pow(Screen.height, 2) + Mathf.Pow(Screen.width, 2)) / Screen.dpi; + Debug.Log("Screen Diagonal is approximately " + instance.ScreensizeInInches + " inches."); } private void Start() diff --git a/Assets/RothenburgAR/Scripts/UI/InputManager.cs b/Assets/RothenburgAR/Scripts/UI/InputManager.cs index 5c9a771..acbbd21 100644 --- a/Assets/RothenburgAR/Scripts/UI/InputManager.cs +++ b/Assets/RothenburgAR/Scripts/UI/InputManager.cs @@ -8,9 +8,14 @@ namespace RothenburgAR.UI { internal class InputManager : Singleton { + public bool AllowCrosshairControls { get; private set; } + + private static readonly float CrosshairControlsDisplaySizeThreshold = 7f; + internal void Initialize() { Input.simulateMouseWithTouches = false; + AllowCrosshairControls = DisplayManager.Instance.ScreensizeInInches >= CrosshairControlsDisplaySizeThreshold; } private void Update() diff --git a/Assets/RothenburgAR/Scripts/UI/TutorialViewBehaviour.cs b/Assets/RothenburgAR/Scripts/UI/TutorialViewBehaviour.cs index b17ff98..60fc4a0 100644 --- a/Assets/RothenburgAR/Scripts/UI/TutorialViewBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/UI/TutorialViewBehaviour.cs @@ -8,12 +8,15 @@ namespace RothenburgAR.UI public TutorialHighlightBehaviour reticuleHighlight; public TutorialHighlightBehaviour menuHighlight; public TutorialHighlightBehaviour selectHighlight; + public GameObject Crosshairs; void OnEnable() { reticuleHighlight.SetText(LanguageManager.Instance.GetString("t_tutorial_reticule")); menuHighlight.SetText(LanguageManager.Instance.GetString("t_tutorial_settings")); selectHighlight.SetText(LanguageManager.Instance.GetString("t_tutorial_select")); + + Crosshairs.SetActive(InputManager.Instance.AllowCrosshairControls); } void Update() diff --git a/RothenburgAR.apk b/RothenburgAR.apk index c60d7a8..b3d964c 100644 Binary files a/RothenburgAR.apk and b/RothenburgAR.apk differ