Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8e044cbb authored by Tao Laurent's avatar Tao Laurent
Browse files

updated loading of InterfaceManager in WebGL to look at the version file in...

updated loading of InterfaceManager in WebGL to look at the version file in build (for the moment it is Beta Only)
parent daa72018
Branches
Tags
2 merge requests!33merge dev in stable for building,!32Merge Bugfixes in Dev Branch to respect workflow changes
......@@ -13,6 +13,7 @@ using UnityEngine;
using UnityEngine.UI;
using Button = UnityEngine.UI.Button;
using Screen = UnityEngine.Screen;
using UnityEngine.Networking;
public class InterfaceManager : MonoBehaviour
{
......@@ -1692,6 +1693,46 @@ public class InterfaceManager : MonoBehaviour
MenuShortcuts.transform.Find("version").gameObject.transform.GetComponent<Text>().text="Version "+reader.ReadToEnd()+ " ("+readergit.ReadToEnd()+")";
reader.Close();
readergit.Close();
#else
string GitVersion=""; string Version="";
bool VersionFound=true;
UnityWebRequest www = UnityWebRequests.Get(MorphoTools.GetServer(), "MorphoNet/Beta/StreamingAssets/version.txt");
yield return www.SendWebRequest();
if (www.isHttpError || www.isNetworkError)
{
InterfaceManager.instance.setComment("Error during version number loading : " + www.error);
}
else
{
if (www.downloadHandler.text != "")
{
Version = www.downloadHandler.text;
}
else
VersionFound = false;
}
if (VersionFound)
{
UnityWebRequest www2 = UnityWebRequests.Get(MorphoTools.GetServer(), "MorphoNet/Beta/StreamingAssets/gitversion.txt");
yield return www2.SendWebRequest();
if (www2.isHttpError || www2.isNetworkError)
{
InterfaceManager.instance.setComment("Error during version number loading : " + www2.error);
}
else
{
if (www2.downloadHandler.text != "")
{
GitVersion = www2.downloadHandler.text;
}
else
VersionFound = false;
}
}
if(VersionFound)
MenuShortcuts.transform.Find("version").gameObject.transform.GetComponent<Text>().text = "Version " + Version + " (" + GitVersion + ")";
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment