From 392d416b0a04466bd447b3a6cae96a3073b45445 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 25 Aug 2018 17:28:21 +0200 Subject: [PATCH] moved logFileHandler from appInitializer to updater to make debugging on android easier fixed bug on android when generating the version map --- .../Scripts/AppInitializerBehaviour.cs | 9 -------- .../Scripts/Updater/UpdaterBehaviour.cs | 23 ++++++++++++++++--- Assets/updaterScene.unity | 15 ++++++------ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Assets/RothenburgAR/Scripts/AppInitializerBehaviour.cs b/Assets/RothenburgAR/Scripts/AppInitializerBehaviour.cs index 9cccc2d..d0124ae 100644 --- a/Assets/RothenburgAR/Scripts/AppInitializerBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/AppInitializerBehaviour.cs @@ -11,18 +11,9 @@ namespace RothenburgAR { public Camera UICamera; - private LogFileHandler logFileHandler = null; - - // Use this for initialization void Start() { -#if !UNITY_EDITOR - logFileHandler = new LogFileHandler(); -#else - Debug.Log("Found Unity Editor; Disabled logging into file."); -#endif - LanguageManager.Instance.LoadLanguagesFromXml(); UIColorSchemeManager.Instance.Initialize(); diff --git a/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs b/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs index 5a055ee..76cf7a6 100644 --- a/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs @@ -12,12 +12,14 @@ namespace RothenburgAR.Updater public class UpdaterBehaviour : MonoBehaviour { public UnityEngine.UI.Slider ProgressBar; + public GameObject UpdateDialog; public GameObject UpdateConfirmationDialog; - - private float afterDownloadWaitTime = 300f; + + private float afterDownloadWaitTime = 10f; public VersioncheckAnswer VersionAnswer { get; set; } private List httpHandlers = new List(); + private LogFileHandler logFileHandler; void Start() { @@ -26,7 +28,15 @@ namespace RothenburgAR.Updater oder beim update auswählen lassen, welche kommen sollen */ +#if !UNITY_EDITOR + logFileHandler = new LogFileHandler(); +#else + Debug.Log("Found Unity Editor; Disabled logging into file."); +#endif + FindObjectsOfType().First().enabled = true; + UpdateDialog.SetActive(false); + UpdateConfirmationDialog.SetActive(false); if (Application.internetReachability == NetworkReachability.NotReachable) { @@ -65,6 +75,8 @@ namespace RothenburgAR.Updater return; } + UpdateDialog.SetActive(true); + if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) { TriggerUpdate(); @@ -78,9 +90,14 @@ namespace RothenburgAR.Updater private string GenerateVersionMap() { - string result = "{"; + string result = "{ "; var rootDir = new DirectoryInfo(PathHelper.ExhibitionPath); + if (!rootDir.Exists) + { + rootDir.Create(); + } + var exhibitionDirs = rootDir.GetDirectories().ToList(); exhibitionDirs.ForEach(dir => { diff --git a/Assets/updaterScene.unity b/Assets/updaterScene.unity index f8a10bc..ce220dc 100644 --- a/Assets/updaterScene.unity +++ b/Assets/updaterScene.unity @@ -209,6 +209,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ProgressBar: {fileID: 1616505721} + UpdateDialog: {fileID: 869888021} UpdateConfirmationDialog: {fileID: 1979410602} --- !u!4 &289788188 Transform: @@ -454,7 +455,7 @@ Camera: m_Enabled: 0 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0.10862067, g: 0.29279917, b: 0.5, a: 1} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -746,7 +747,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_text: Es wurden Inhaltsupdates gefunden. Bitte warten Sie, bis diese Installiert + m_text: Es wurden Inhaltsupdates gefunden. Bitte warten sie, bis diese installiert wurden. m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 715b80e429c437e40867928a4e1fc975, type: 2} @@ -1063,11 +1064,11 @@ MonoBehaviour: lineCount: 3 pageCount: 1 materialCount: 1 - m_havePropertiesChanged: 1 + m_havePropertiesChanged: 0 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_spriteAnimator: {fileID: 0} - m_isInputParsingRequired: 1 + m_isInputParsingRequired: 0 m_inputSource: 0 m_hasFontAssetChanged: 0 m_subTextObjects: @@ -1545,7 +1546,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1979410603 RectTransform: m_ObjectHideFlags: 0 @@ -1877,11 +1878,11 @@ MonoBehaviour: lineCount: 1 pageCount: 1 materialCount: 1 - m_havePropertiesChanged: 1 + m_havePropertiesChanged: 0 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_spriteAnimator: {fileID: 0} - m_isInputParsingRequired: 1 + m_isInputParsingRequired: 0 m_inputSource: 0 m_hasFontAssetChanged: 0 m_subTextObjects: