From e74dd2861efe6ef6eb13dc1e97335e21791e4370 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 26 Oct 2018 16:42:42 +0200 Subject: [PATCH] Fontsize now affects exhibit titles --- Assets/Resources/Prefabs/ExhibitTitle.prefab | 13 +++++++++++++ .../Scripts/UI/DetailsPanelBehaviour.cs | 1 - .../RothenburgAR/Scripts/UI/FontsizeManager.cs | 11 +++++++---- .../Scripts/UI/FontsizeSelectViewBehaviour.cs | 8 ++++++++ .../RothenburgAR/Scripts/UI/FontsizeSelector.cs | 16 ++++++++-------- .../Scripts/UI/TrackableEventHandler.cs | 2 ++ .../Scripts/Updater/UpdaterBehaviour.cs | 2 +- ProjectSettings/ProjectSettings.asset | 2 +- 8 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Assets/Resources/Prefabs/ExhibitTitle.prefab b/Assets/Resources/Prefabs/ExhibitTitle.prefab index 5251f37..fc67373 100644 --- a/Assets/Resources/Prefabs/ExhibitTitle.prefab +++ b/Assets/Resources/Prefabs/ExhibitTitle.prefab @@ -42,6 +42,7 @@ GameObject: - component: {fileID: 222811054124192620} - component: {fileID: 114580846098669954} - component: {fileID: 114748046949405592} + - component: {fileID: 114657141587138028} m_Layer: 0 m_Name: TextMeshPro m_TagString: Untagged @@ -318,6 +319,18 @@ MonoBehaviour: - {fileID: 0} - {fileID: 0} m_maskType: 0 +--- !u!114 &114657141587138028 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1153460862401542} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b136c9157840904ba79e96d50f494bc, type: 3} + m_Name: + m_EditorClassIdentifier: + SizeClass: 2 --- !u!114 &114748046949405592 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/RothenburgAR/Scripts/UI/DetailsPanelBehaviour.cs b/Assets/RothenburgAR/Scripts/UI/DetailsPanelBehaviour.cs index f7c8095..aac8f15 100644 --- a/Assets/RothenburgAR/Scripts/UI/DetailsPanelBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/UI/DetailsPanelBehaviour.cs @@ -75,7 +75,6 @@ namespace RothenburgAR.UI { ModelButton.SetActive(false); } - //TODO implement } public void SwitchToFullscreenModelView() diff --git a/Assets/RothenburgAR/Scripts/UI/FontsizeManager.cs b/Assets/RothenburgAR/Scripts/UI/FontsizeManager.cs index 632fe93..1f77a5e 100644 --- a/Assets/RothenburgAR/Scripts/UI/FontsizeManager.cs +++ b/Assets/RothenburgAR/Scripts/UI/FontsizeManager.cs @@ -20,14 +20,16 @@ namespace RothenburgAR.UI FontsizeSetting.Default, new Dictionary { {FontsizeClass.Header, 40f}, - {FontsizeClass.Body, 25f} + {FontsizeClass.Body, 25f}, + {FontsizeClass.ExhibitTitle, 1f} } }, { FontsizeSetting.Large, new Dictionary { - {FontsizeClass.Header, 55f}, - {FontsizeClass.Body, 30f} + {FontsizeClass.Header, 48}, + {FontsizeClass.Body, 30f}, + {FontsizeClass.ExhibitTitle, 1.2f} } } }; @@ -75,6 +77,7 @@ namespace RothenburgAR.UI public enum FontsizeClass { Header, - Body + Body, + ExhibitTitle } } \ No newline at end of file diff --git a/Assets/RothenburgAR/Scripts/UI/FontsizeSelectViewBehaviour.cs b/Assets/RothenburgAR/Scripts/UI/FontsizeSelectViewBehaviour.cs index db6a076..5cd26c8 100644 --- a/Assets/RothenburgAR/Scripts/UI/FontsizeSelectViewBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/UI/FontsizeSelectViewBehaviour.cs @@ -47,6 +47,14 @@ namespace RothenburgAR.UI { Debug.Log("Switching Font size to '" + Enum.GetName(typeof(FontsizeSetting), setting) + "'"); FontsizeManager.Instance.CurrentFontsizeSetting = setting; + + StateManager sm = TrackerManager.Instance.GetStateManager(); + foreach (var item in sm.GetActiveTrackableBehaviours()) + { + var teh = item.gameObject.GetComponent(); + teh.OnTrackableStateChanged(TrackableBehaviour.Status.NOT_FOUND, TrackableBehaviour.Status.TRACKED); + } + SwitchToARView(); } } diff --git a/Assets/RothenburgAR/Scripts/UI/FontsizeSelector.cs b/Assets/RothenburgAR/Scripts/UI/FontsizeSelector.cs index 3f329e7..b21735a 100644 --- a/Assets/RothenburgAR/Scripts/UI/FontsizeSelector.cs +++ b/Assets/RothenburgAR/Scripts/UI/FontsizeSelector.cs @@ -10,21 +10,21 @@ namespace RothenburgAR.UI void OnEnable() { - var tmproText = gameObject.GetComponent(); - if (tmproText != null) + var tmproTextUI = gameObject.GetComponent(); + if (tmproTextUI != null) { - tmproText.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass); + tmproTextUI.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass); //tmproText.enableAutoSizing = true; //tmproText.fontSizeMax = FontsizeManager.Instance.GetFontsize(this.SizeClass); //tmproText.fontSizeMin = tmproText.fontSizeMax * 0.8f; } - } - - void Update() - { + var tmproText = gameObject.GetComponent(); + if (tmproText != null) + { + tmproText.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass); + } } } - } \ No newline at end of file diff --git a/Assets/RothenburgAR/Scripts/UI/TrackableEventHandler.cs b/Assets/RothenburgAR/Scripts/UI/TrackableEventHandler.cs index 60440a0..c257cee 100644 --- a/Assets/RothenburgAR/Scripts/UI/TrackableEventHandler.cs +++ b/Assets/RothenburgAR/Scripts/UI/TrackableEventHandler.cs @@ -16,6 +16,8 @@ namespace RothenburgAR.UI // Dynamically load Title when Exhibit is found ExhibitTitleBehaviour titleElement = Exhibit.TitleBehaviour; titleElement.DisplayText = titleElement.DataText.GetTextByLanguage(LanguageManager.Instance.CurrentLanguageKey); + titleElement.gameObject.SetActive(false); + titleElement.gameObject.SetActive(true); } diff --git a/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs b/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs index 459b874..c784a2c 100644 --- a/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs @@ -332,7 +332,7 @@ namespace RothenburgAR.Updater else { UpdateCompletedDialog.SetActive(false); - downloadEndedTime = DateTime.Now.AddSeconds(1); + downloadEndedTime = DateTime.Now.AddYears(1); } } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index ef4ac51..2ee515f 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -571,7 +571,7 @@ PlayerSettings: webGLCompressionFormat: 1 scriptingDefineSymbols: 1: TMP_PRESENT - 4: VUFORIA_IOS_SETTINGS + 4: VUFORIA_IOS_SETTINGS;TMP_PRESENT 7: TMP_PRESENT 14: VUFORIA_WSA_SETTINGS platformArchitecture: {}