Added first version for updater
This commit is contained in:
10
Assets/JsonDotNet.meta
Normal file
10
Assets/JsonDotNet.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fb97a4652b1c334c93e2e854d69b27f
|
||||
folderAsset: yes
|
||||
timeCreated: 1534264533
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/JsonDotNet/Assemblies.meta
Normal file
9
Assets/JsonDotNet/Assemblies.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 577d9725f58264943855b8ac185531fe
|
||||
folderAsset: yes
|
||||
timeCreated: 1466788344
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/JsonDotNet/Assemblies/AOT.meta
Normal file
9
Assets/JsonDotNet/Assemblies/AOT.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14f21d7a1e53a8c4e87b25526a7eb63c
|
||||
folderAsset: yes
|
||||
timeCreated: 1466788345
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8015
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.XML
Normal file
8015
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.XML
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aadad8ac54f29e44583510294ac5c312
|
||||
timeCreated: 1466788355
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll
Normal file
BIN
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll
Normal file
Binary file not shown.
76
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta
Normal file
76
Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta
Normal file
@@ -0,0 +1,76 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a3c684705042f345975d924f6983e36
|
||||
timeCreated: 1466788352
|
||||
licenseType: Store
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Any:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
Linux64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
OSXIntel:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
SamsungTV:
|
||||
enabled: 1
|
||||
settings:
|
||||
STV_MODEL: STANDARD_13
|
||||
Tizen:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
WebGL:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
Win:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Win64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
WindowsStoreApps:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DontProcess: False
|
||||
PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
|
||||
SDK: AnySDK
|
||||
ScriptingBackend: Il2Cpp
|
||||
iOS:
|
||||
enabled: 1
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
tvOS:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/JsonDotNet/Assemblies/Standalone.meta
Normal file
9
Assets/JsonDotNet/Assemblies/Standalone.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01ef782d02bb1994dbe418b69432552b
|
||||
folderAsset: yes
|
||||
timeCreated: 1466788344
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8040
Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.XML
Normal file
8040
Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.XML
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6807fedb8dcaf04682d2c84f0ab753f
|
||||
timeCreated: 1466788355
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
Normal file
BIN
Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
Normal file
Binary file not shown.
@@ -0,0 +1,75 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17aef65a15b471f468b5fbeb4ff0c6a1
|
||||
timeCreated: 1466788349
|
||||
licenseType: Store
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Any:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
Linux64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
LinuxUniversal:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXUniversal:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
SamsungTV:
|
||||
enabled: 0
|
||||
settings:
|
||||
STV_MODEL: STANDARD_13
|
||||
Win:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Win64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
WindowsStoreApps:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DontProcess: False
|
||||
PlaceholderPath:
|
||||
SDK: AnySDK
|
||||
ScriptingBackend: Il2Cpp
|
||||
iOS:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/JsonDotNet/Assemblies/Windows.meta
Normal file
9
Assets/JsonDotNet/Assemblies/Windows.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1418141139a6ac443b18cb05c0643a29
|
||||
folderAsset: yes
|
||||
timeCreated: 1466788345
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7977
Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.XML
Normal file
7977
Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.XML
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36f7323c55864364d8bb88c736e4bca6
|
||||
timeCreated: 1466788355
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll
Normal file
BIN
Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll
Normal file
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b6ba260dada0ea4a871a42011f8b87d
|
||||
timeCreated: 1466788355
|
||||
licenseType: Store
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Any:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
Linux64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
OSXIntel:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
SamsungTV:
|
||||
enabled: 0
|
||||
settings:
|
||||
STV_MODEL: STANDARD_13
|
||||
Win:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Win64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
WindowsStoreApps:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DontProcess: False
|
||||
PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
|
||||
SDK: AnySDK
|
||||
ScriptingBackend: DotNet
|
||||
iOS:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/JsonDotNet/Documentation.meta
Normal file
9
Assets/JsonDotNet/Documentation.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76f828f47ce26cc43991113c6a39dbbf
|
||||
folderAsset: yes
|
||||
timeCreated: 1466010535
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/JsonDotNet/Documentation/Json Net for Unity 2.0.1.pdf
Normal file
BIN
Assets/JsonDotNet/Documentation/Json Net for Unity 2.0.1.pdf
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e7d9a07cc3f02a41a575406e7230846
|
||||
timeCreated: 1466788421
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/JsonDotNet/JsonDotNet201Source.zip
Normal file
BIN
Assets/JsonDotNet/JsonDotNet201Source.zip
Normal file
Binary file not shown.
8
Assets/JsonDotNet/JsonDotNet201Source.zip.meta
Normal file
8
Assets/JsonDotNet/JsonDotNet201Source.zip.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a6f8c7c1ea72ce46831c5e1b6150d0c
|
||||
timeCreated: 1466790933
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/JsonDotNet/link.xml
Normal file
7
Assets/JsonDotNet/link.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<linker>
|
||||
<assembly fullname="System">
|
||||
<type fullname="System.ComponentModel.TypeConverter" preserve="all" />
|
||||
<!-- <namespace fullname="System.ComponentModel" preserve="all" /> -->
|
||||
</assembly>
|
||||
</linker>
|
||||
6
Assets/JsonDotNet/link.xml.meta
Normal file
6
Assets/JsonDotNet/link.xml.meta
Normal file
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06314f49bdda26043963578d60a0a7ee
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,8 +25,6 @@ namespace RothenburgAR.Exhibition
|
||||
return false;
|
||||
|
||||
// Todo: More validations
|
||||
|
||||
// TODO: POIs sollen ein optionales Sprite erhalten - Angeben in der XML und laden von der Platte
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,8 +45,6 @@ namespace RothenburgAR.Exhibition
|
||||
|
||||
string exhibitionId = doc.DocumentElement.Attributes["id"].Value;
|
||||
|
||||
// Todo: Implement "Title"
|
||||
|
||||
PreloadedExhibition resultExhibition = new PreloadedExhibition
|
||||
{
|
||||
ContainedExhibits = new List<PreloadedExhibit>(),
|
||||
|
||||
10
Assets/RothenburgAR/Scripts/Updater.meta
Normal file
10
Assets/RothenburgAR/Scripts/Updater.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04af75ade4f76434a8a2025477f03af9
|
||||
folderAsset: yes
|
||||
timeCreated: 1534257697
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
72
Assets/RothenburgAR/Scripts/Updater/ApiInfo.cs
Normal file
72
Assets/RothenburgAR/Scripts/Updater/ApiInfo.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace RothenburgAR.Updater
|
||||
{
|
||||
[Serializable]
|
||||
public class ApiInfo
|
||||
{
|
||||
private static string baseUrl = "https://lambdalike.pa.kaim.network";
|
||||
|
||||
public static string VersionCheckEndpoint
|
||||
{
|
||||
get { return baseUrl + "/versioncheck"; }
|
||||
}
|
||||
|
||||
public static string ExhibitionEndpoint
|
||||
{
|
||||
get { return baseUrl + "/meta/{id}/{lang}"; }
|
||||
}
|
||||
public static string FileEndpoint
|
||||
{
|
||||
get { return baseUrl + "/files/{id}"; }
|
||||
}
|
||||
public static string TrackerEndpoint
|
||||
{
|
||||
get { return baseUrl + "/tracker/{id}"; }
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class VersioncheckAnswer
|
||||
{
|
||||
public List<string> languages { get; set; }
|
||||
public List<Version> data { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Version
|
||||
{
|
||||
public string id { get; set; }
|
||||
public VersionInfo meta;
|
||||
//VersionInfo tracker;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class VersionInfo
|
||||
{
|
||||
public VersionStatus status;
|
||||
public string updateUrl;
|
||||
}
|
||||
|
||||
public enum VersionStatus
|
||||
{
|
||||
ok,
|
||||
updated,
|
||||
deleted
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ExhibitionData
|
||||
{
|
||||
public string title { get; set; }
|
||||
public string description { get; set; }
|
||||
public List<string> tags { get; set; }
|
||||
public List<string> exhibitionIds { get; set; }
|
||||
public string mediaId { get; set; }
|
||||
public object createdTime { get; set; }
|
||||
public object updatedTime { get; set; }
|
||||
public string id { get; set; }
|
||||
public List<string> pois { get; set; }
|
||||
}
|
||||
}
|
||||
13
Assets/RothenburgAR/Scripts/Updater/ApiInfo.cs.meta
Normal file
13
Assets/RothenburgAR/Scripts/Updater/ApiInfo.cs.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a76ff73dc064a3642a18497d15719d10
|
||||
timeCreated: 1534357024
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
63
Assets/RothenburgAR/Scripts/Updater/HttpHandler.cs
Normal file
63
Assets/RothenburgAR/Scripts/Updater/HttpHandler.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace RothenburgAR.Updater
|
||||
{
|
||||
public class HttpRequest
|
||||
{
|
||||
private string url;
|
||||
private HttpVerb verb;
|
||||
private string uploadData;
|
||||
|
||||
public HttpRequest(String url, HttpVerb verb, String uploadData = null)
|
||||
{
|
||||
this.url = url;
|
||||
this.verb = verb;
|
||||
this.uploadData = uploadData;
|
||||
}
|
||||
|
||||
public HttpHandler send()
|
||||
{
|
||||
UploadHandlerRaw ul = new UploadHandlerRaw(Encoding.UTF8.GetBytes(uploadData.ToCharArray()));
|
||||
DownloadHandler dl = new DownloadHandlerBuffer();
|
||||
|
||||
string verb = Enum.GetName(typeof(HttpVerb), this.verb);
|
||||
|
||||
UnityWebRequest wr = new UnityWebRequest(url, verb, dl, ul);
|
||||
wr.SetRequestHeader("Content-Type", "application/json;charset=UTF-8"); //or sth like that
|
||||
|
||||
var operation = wr.SendWebRequest();
|
||||
|
||||
return new HttpHandler(ul, dl, wr, operation);
|
||||
}
|
||||
}
|
||||
|
||||
public enum HttpVerb
|
||||
{
|
||||
GET,
|
||||
POST,
|
||||
PUT,
|
||||
DELETE
|
||||
}
|
||||
|
||||
public class HttpHandler
|
||||
{
|
||||
public UploadHandler upload { get; set; }
|
||||
public DownloadHandler download { get; set; }
|
||||
public UnityWebRequest request { get; set; }
|
||||
public UnityWebRequestAsyncOperation operation {get;set;}
|
||||
|
||||
public HttpHandler(UploadHandler upload, DownloadHandler download, UnityWebRequest request, UnityWebRequestAsyncOperation operation)
|
||||
{
|
||||
this.upload = upload;
|
||||
this.download = download;
|
||||
this.request = request;
|
||||
this.operation = operation;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
13
Assets/RothenburgAR/Scripts/Updater/HttpHandler.cs.meta
Normal file
13
Assets/RothenburgAR/Scripts/Updater/HttpHandler.cs.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b86098bd8091364fa115b01f2e4cc3e
|
||||
timeCreated: 1534260448
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
93
Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs
Normal file
93
Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace RothenburgAR.Updater
|
||||
{
|
||||
public class UpdaterBehaviour : MonoBehaviour
|
||||
{
|
||||
public VersioncheckAnswer VersionAnswer { get; set; }
|
||||
|
||||
void Start()
|
||||
{
|
||||
/*
|
||||
zum app-start einmal prüfen, wenn neues da ist anzeigen und evtl. runterladen (wenn nicht getaktete verbindung)
|
||||
neue startszene, die guckt und updatet und dann zur mainScene weiterleitet
|
||||
auf getaktete verbindung prüfen (Application.internetReachability)
|
||||
|
||||
punkt zum eintragen der credentials? user will ja nur seine/nur bestimmte exhibitions haben schätz ich
|
||||
oder beim update auswählen lassen, welche kommen sollen
|
||||
*/
|
||||
|
||||
if (Application.internetReachability == NetworkReachability.NotReachable)
|
||||
{
|
||||
// just continue to app
|
||||
LoadMainScene();
|
||||
return;
|
||||
}
|
||||
|
||||
CheckForUpdates();
|
||||
}
|
||||
|
||||
private void CheckForUpdates()
|
||||
{
|
||||
// check for updates and ask for permission to download if there are any
|
||||
|
||||
//TODO generate versionmap (i guess by crawling all subdirs of /exhibitions)
|
||||
string versionMap = "[]";
|
||||
HttpHandler httpHandler = new HttpRequest(ApiInfo.VersionCheckEndpoint, HttpVerb.POST, versionMap).send();
|
||||
|
||||
// httpHandler.operation.progress needs to be polled
|
||||
httpHandler.operation.completed += ar =>
|
||||
{
|
||||
//TODO check for network errors/timeouts (and find out if operation.completed() is the right place for that)
|
||||
Debug.Log(httpHandler.download.text);
|
||||
|
||||
//versionAnswer = JsonConvert.DeserializeObject<VersioncheckAnswer>(httpHandler.download.text);
|
||||
VersionAnswer = JsonConvert.DeserializeObject<VersioncheckAnswer>(@"{""data"":[{""id"":""a"",""meta"":{""status"":""ok"",""updateUrl"":""https://lambdalike.pa.kaim.network/meta/006e164c-5e31-4ddf-adf5-df7016c8b3a7/de""}},{""id"":""b"",""meta"":{""status"":""updated"",""updateUrl"":""https://lambdalike.pa.kaim.network/meta/006e164c-5e31-4ddf-adf5-df7016c8b3a7/de""}}]}");
|
||||
|
||||
if (VersionAnswer.data.TrueForAll(d => d.meta.status == VersionStatus.ok))
|
||||
{
|
||||
// no updates required, continue to app
|
||||
LoadMainScene();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
|
||||
{
|
||||
TriggerUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO ask for user permission to perform update
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void TriggerUpdate()
|
||||
{
|
||||
// TODO instantiate component that performs the update?
|
||||
/* trigger tiered updates in order
|
||||
* languages //no http
|
||||
* data //no http
|
||||
* tracker //1 request
|
||||
* meta //1 request
|
||||
* poi //n requests
|
||||
* media //n requests
|
||||
*/
|
||||
}
|
||||
|
||||
private static void LoadMainScene()
|
||||
{
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene("mainScene");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
13
Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs.meta
Normal file
13
Assets/RothenburgAR/Scripts/Updater/UpdaterBehaviour.cs.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f086f910087528a48b17fdfced69c0c9
|
||||
timeCreated: 1534257778
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
236
Assets/updaterScene.unity
Normal file
236
Assets/updaterScene.unity
Normal file
@@ -0,0 +1,236 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &289788186
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 289788188}
|
||||
- component: {fileID: 289788187}
|
||||
m_Layer: 0
|
||||
m_Name: ScriptContainer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &289788187
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 289788186}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f086f910087528a48b17fdfced69c0c9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &289788188
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 289788186}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &603935591
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 603935595}
|
||||
- component: {fileID: 603935594}
|
||||
- component: {fileID: 603935593}
|
||||
- component: {fileID: 603935592}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &603935592
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 603935591}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &603935593
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 603935591}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &603935594
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 603935591}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &603935595
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 603935591}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
9
Assets/updaterScene.unity.meta
Normal file
9
Assets/updaterScene.unity.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 974eb12c09ab8804392cefb59d4a0de8
|
||||
timeCreated: 1534257720
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -4,4 +4,7 @@
|
||||
EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes: []
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/updaterScene.unity
|
||||
guid: 974eb12c09ab8804392cefb59d4a0de8
|
||||
|
||||
Reference in New Issue
Block a user