moved logFileHandler from appInitializer to updater to make debugging on android easier

fixed bug on android when generating the version map
This commit is contained in:
2018-08-25 17:28:21 +02:00
parent 18fd0c6969
commit 392d416b0a
3 changed files with 28 additions and 19 deletions

View File

@@ -11,18 +11,9 @@ namespace RothenburgAR
{ {
public Camera UICamera; public Camera UICamera;
private LogFileHandler logFileHandler = null;
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
#if !UNITY_EDITOR
logFileHandler = new LogFileHandler();
#else
Debug.Log("Found Unity Editor; Disabled logging into file.");
#endif
LanguageManager.Instance.LoadLanguagesFromXml(); LanguageManager.Instance.LoadLanguagesFromXml();
UIColorSchemeManager.Instance.Initialize(); UIColorSchemeManager.Instance.Initialize();

View File

@@ -12,12 +12,14 @@ namespace RothenburgAR.Updater
public class UpdaterBehaviour : MonoBehaviour public class UpdaterBehaviour : MonoBehaviour
{ {
public UnityEngine.UI.Slider ProgressBar; public UnityEngine.UI.Slider ProgressBar;
public GameObject UpdateDialog;
public GameObject UpdateConfirmationDialog; public GameObject UpdateConfirmationDialog;
private float afterDownloadWaitTime = 300f; private float afterDownloadWaitTime = 10f;
public VersioncheckAnswer VersionAnswer { get; set; } public VersioncheckAnswer VersionAnswer { get; set; }
private List<HttpHandler> httpHandlers = new List<HttpHandler>(); private List<HttpHandler> httpHandlers = new List<HttpHandler>();
private LogFileHandler logFileHandler;
void Start() void Start()
{ {
@@ -26,7 +28,15 @@ namespace RothenburgAR.Updater
oder beim update auswählen lassen, welche kommen sollen 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<Camera>().First().enabled = true; FindObjectsOfType<Camera>().First().enabled = true;
UpdateDialog.SetActive(false);
UpdateConfirmationDialog.SetActive(false);
if (Application.internetReachability == NetworkReachability.NotReachable) if (Application.internetReachability == NetworkReachability.NotReachable)
{ {
@@ -65,6 +75,8 @@ namespace RothenburgAR.Updater
return; return;
} }
UpdateDialog.SetActive(true);
if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
{ {
TriggerUpdate(); TriggerUpdate();
@@ -81,6 +93,11 @@ namespace RothenburgAR.Updater
string result = "{ "; string result = "{ ";
var rootDir = new DirectoryInfo(PathHelper.ExhibitionPath); var rootDir = new DirectoryInfo(PathHelper.ExhibitionPath);
if (!rootDir.Exists)
{
rootDir.Create();
}
var exhibitionDirs = rootDir.GetDirectories().ToList(); var exhibitionDirs = rootDir.GetDirectories().ToList();
exhibitionDirs.ForEach(dir => exhibitionDirs.ForEach(dir =>
{ {

View File

@@ -209,6 +209,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ProgressBar: {fileID: 1616505721} ProgressBar: {fileID: 1616505721}
UpdateDialog: {fileID: 869888021}
UpdateConfirmationDialog: {fileID: 1979410602} UpdateConfirmationDialog: {fileID: 1979410602}
--- !u!4 &289788188 --- !u!4 &289788188
Transform: Transform:
@@ -454,7 +455,7 @@ Camera:
m_Enabled: 0 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_ClearFlags: 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: m_NormalizedViewPortRect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
@@ -746,7 +747,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 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. wurden.
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 715b80e429c437e40867928a4e1fc975, type: 2} m_fontAsset: {fileID: 11400000, guid: 715b80e429c437e40867928a4e1fc975, type: 2}
@@ -1063,11 +1064,11 @@ MonoBehaviour:
lineCount: 3 lineCount: 3
pageCount: 1 pageCount: 1
materialCount: 1 materialCount: 1
m_havePropertiesChanged: 1 m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0 m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0 m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0} m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1 m_isInputParsingRequired: 0
m_inputSource: 0 m_inputSource: 0
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_subTextObjects: m_subTextObjects:
@@ -1545,7 +1546,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!224 &1979410603 --- !u!224 &1979410603
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1877,11 +1878,11 @@ MonoBehaviour:
lineCount: 1 lineCount: 1
pageCount: 1 pageCount: 1
materialCount: 1 materialCount: 1
m_havePropertiesChanged: 1 m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0 m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0 m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0} m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1 m_isInputParsingRequired: 0
m_inputSource: 0 m_inputSource: 0
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_subTextObjects: m_subTextObjects: