Skip to content
Snippets Groups Projects
Commit 23ce7948 authored by Marco Zimmer's avatar Marco Zimmer
Browse files

+New Polymorphismus for JSON serialization for Solution-/FactOrganizer and...

+New Polymorphismus for JSON serialization for Solution-/FactOrganizer and Fact; +added using keyword for UnityWebRequest
parent 227956e9
No related branches found
No related tags found
No related merge requests found
Showing
with 126 additions and 324 deletions
......@@ -149,7 +149,7 @@ void PrepareGame()
IEnumerator ServerRoutine(String NetwAddress, int NA_id, double ics)
{
UnityWebRequest request = UnityWebRequest.Get("http://" + NetwAddress + "/scroll/list");
using UnityWebRequest request = UnityWebRequest.Get("http://" + NetwAddress + "/scroll/list");
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.ConnectionError
......@@ -160,10 +160,10 @@ IEnumerator ServerRoutine(String NetwAddress, int NA_id, double ics)
while (true)
{
request = UnityWebRequest.Get("http://" + NetwAddress + "/scroll/list");
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.ConnectionError
|| request.result == UnityWebRequest.Result.ProtocolError)
using UnityWebRequest request2 = UnityWebRequest.Get("http://" + NetwAddress + "/scroll/list");
yield return request2.SendWebRequest();
if (request2.result == UnityWebRequest.Result.ConnectionError
|| request2.result == UnityWebRequest.Result.ProtocolError)
{
// UnityEngine.Debug.Log("no running server");
}
......
......@@ -7,6 +7,7 @@ public class GenerateDemoFiles
{
public static void GenerateAll()
{
Debug.LogWarning("Generating and Overwriting Stage Files");
GenerateDemoA();
GenerateDemoB();
}
......
......@@ -6,7 +6,7 @@
using Newtonsoft.Json;
using static JSONManager;
using static CommunicationEvents;
using JsonSubTypes;
public class ParsingDictionary {
//TODO? get rid of this, use reflection? instead, if possible
......@@ -50,7 +50,7 @@ public static bool sendAdd(string path, string body, out string uri)
Debug.Log("Sending to Server:\n" + body);
//Put constructor parses stringbody to byteArray internally (goofy workaround)
UnityWebRequest www = UnityWebRequest.Put(path, body);
using UnityWebRequest www = UnityWebRequest.Put(path, body);
www.method = UnityWebRequest.kHttpVerbPOST;
www.SetRequestHeader("Content-Type", "application/json");
www.timeout = 1;
......@@ -83,6 +83,12 @@ public static bool sendAdd(string path, string body, out string uri)
/// <summary>
/// %Fact representation of Unity; mostly mirrors Facts of MMT.
/// </summary>
[JsonConverter(typeof(JsonSubtypes), "s_type")]
[JsonSubtypes.KnownSubType(typeof(PointFact), "PointFact")]
[JsonSubtypes.KnownSubType(typeof(LineFact), "LineFact")]
[JsonSubtypes.KnownSubType(typeof(RayFact), "RayFact")]
[JsonSubtypes.KnownSubType(typeof(OnLineFact), "OnLineFact")]
[JsonSubtypes.KnownSubType(typeof(AngleFact), "AngleFact")]
public abstract class Fact
{
/// <summary>
......@@ -92,6 +98,11 @@ public abstract class Fact
[JsonIgnore]
public GameObject Representation;
/// <value>
/// [ClassName] for JSON de-/serialization
/// </value>
public new string s_type;
/// <value>
/// Unique Id. e.g.: MMT URI
/// </value>
......@@ -470,6 +481,9 @@ protected override bool EquivalentWrapped(AbstractLineFact f1, AbstractLineFact
/// </summary>
public class PointFact : FactWrappedCRTP<PointFact>
{
/// \copydoc Fact.s_type
public new string s_type = "PointFact";
/// <summary> Position </summary>
public Vector3 Point;
/// <summary> Orientation for <see cref="Fact.Representation"/> </summary>
......@@ -600,6 +614,9 @@ protected override bool EquivalentWrapped(PointFact f1, PointFact f2)
/// </summary>
public class LineFact : AbstractLineFactWrappedCRTP<LineFact>
{
/// \copydoc Fact.s_type
public new string s_type = "LineFact";
/// <summary> Distance between <see cref="AbstractLineFact.Pid1"/> and <see cref="AbstractLineFact.Pid2"/></summary>
public float Distance;
......@@ -722,6 +739,9 @@ private void SetDistance()
/// </summary>
public class RayFact : AbstractLineFactWrappedCRTP<RayFact>
{
/// \copydoc Fact.s_type
public new string s_type = "RayFact";
/// <summary> \copydoc Fact.Fact </summary>
public RayFact() : base() { }
......@@ -822,6 +842,9 @@ protected override bool EquivalentWrapped(RayFact f1, RayFact f2)
/// </summary>
public class OnLineFact : FactWrappedCRTP<OnLineFact>
{
/// \copydoc Fact.s_type
public new string s_type = "OnLineFact";
public string
/// <summary> <see cref="PointFact"/>.<see cref="Fact.Id">Id</see> </summary>
Pid,
......@@ -976,6 +999,9 @@ protected override bool EquivalentWrapped(OnLineFact f1, OnLineFact f2)
/// </summary>
public class AngleFact : FactWrappedCRTP<AngleFact>
{
/// \copydoc Fact.s_type
public new string s_type = "AngleFact";
/// @{ <summary>
/// One <see cref="Fact.Id">Id</see> of three <see cref="PointFact">PointFacts</see> defining Angle [<see cref="Pid1"/>, <see cref="Pid2"/>, <see cref="Pid3"/>].
/// </summary>
......
......@@ -24,22 +24,26 @@ public class FactOrganizer
/// - <c>Key</c>: <see cref="Fact.Id"/>
/// - <c>Value</c>: <see cref="Fact"/>
/// </summary>
[JsonProperty]
protected internal Dictionary<string, Fact> FactDict;
/// <summary>
/// - <c>Key</c>: <see cref="Fact.Id"/>
/// - <c>Value</c>: <see cref="meta"/>
/// </summary>
[JsonProperty]
protected internal Dictionary<string, meta> MetaInf = new Dictionary<string, meta>();
/// <summary>
/// Keeps track of insertion/ deletion/ etc. operations for <see cref="undo"/> and <see cref="redo"/>
/// </summary>
[JsonProperty]
protected internal List<stepnote> Workflow = new List<stepnote>();
/// <summary>
/// Notes position in <see cref="Workflow"/> for <see cref="undo"/> and <see cref="redo"/>; the pointed to element is non-acitve
/// </summary>
[JsonProperty]
protected internal int marker = 0;
/// <summary>
......@@ -48,6 +52,7 @@ public class FactOrganizer
/// One step can consist of multiple operations.
/// <seealso cref="stepnote"/>
/// </summary>
[JsonProperty]
protected internal int worksteps = 0;
/// <summary>
/// Backlock logic redundant - for convinience.
......@@ -55,33 +60,38 @@ public class FactOrganizer
/// One step can consist of multiple operations.
/// <seealso cref="stepnote"/>
/// </summary>
[JsonProperty]
protected internal int backlog = 0;
/// <summary>
/// Set to <c>true</c> if recently been resetted.
/// </summary>
[JsonProperty]
protected internal bool soft_resetted = false;
/// <summary>
/// If set to <c>true</c>, <see cref="Remove(string, bool)"/> and <see cref="Add(Fact, out bool, bool)"/> will invoke <see cref="CommunicationEvents.RemoveFactEvent"/> and <see cref="CommunicationEvents.AddFactEvent"/> respectively.
/// </summary>
[JsonProperty]
public bool invoke;
// TODO? SE: better seperation
/// <summary>
/// Keeps track of maximum <see cref="Fact.LabelId"/> for <see cref="Fact.generateLabel"/>.
/// </summary>
[JsonProperty]
protected internal int MaxLabelId = 0;
/// <summary>
/// Stores unused <see cref="Fact.LabelId"/> for <see cref="Fact.generateLabel"/>, wich were freed in <see cref="Fact.freeAutoLabel"/> for later reuse to keep naming space compact.
/// </summary>
[JsonProperty]
protected internal SortedSet<int> UnusedLabelIds = new SortedSet<int>();
// TODO: put this stuff in Interface
/// @{ <summary>
/// For <see cref="store(string, List<Directories>, bool, bool)"/> and <see cref="load(ref FactOrganizer, bool, string, List<Directories>, bool, out Dictionary<string, string>)"/>
/// </summary>
private string path = null;
protected internal string path = null;
private static List<Directories>
hierState = new List<Directories> { Directories.FactStateMachines };
/// @}
......@@ -174,6 +184,15 @@ public meta(int workflow_id, bool active = true)
}
}
/// <summary>
/// Only used by <see cref="JsonConverter"/> to initiate empty instance.
/// </summary>
public FactOrganizer()
{
FactDict = new Dictionary<string, Fact>();
this.invoke = false;
}
/// <summary>
/// Standard Constructor for empty, ready to use <see cref="FactOrganizer"/>
/// </summary>
......@@ -185,89 +204,61 @@ public FactOrganizer(bool invoke = false)
}
/// <summary>
/// Used to parse <see cref="JsonReader"/>/ <see cref="JsonWriter"/> readable and creatable <see cref="PublicFactOrganizer">format</see> of this <see cref="FactOrganizer">class</see> to an actual instance of this <see cref="FactOrganizer">class</see>.
/// <remarks>TODO: repair and use <see cref="JSONManager.JsonInheritenceConverter<T>"/> o.s. to bypass all of this _hardwired_ implementation, including the entirety of <see cref="PublicFactOrganizer"/></remarks>
/// Used to parse read-in <see cref="FactOrganizer"/> by <see cref="JsonReader"/> and make <see cref="Fact.Id"/> conform.
/// </summary>
/// <param name="set">to be parsed into, will be overwritten.
/// If <c><paramref name="invoke"/> = true</c>, <paramref name="set"/> should be <see cref="StageStatic.stage.factState"/>, outherwise <see cref="InvokeFactEvent(bool, string)"/> will cause <see cref="Exception">Exceptions</see> when it invokes Events of <see cref="CommunicationEvents"/></param>
/// <param name="exposed">instance to be parsed</param>
/// <param name="target">to be parsed into, will be overwritten.
/// If <c><paramref name="invoke"/> = true</c>, <paramref name="target"/> should be <see cref="StageStatic.stage.factState"/>, outherwise <see cref="InvokeFactEvent(bool, string)"/> will cause <see cref="Exception">Exceptions</see> when it invokes Events of <see cref="CommunicationEvents"/></param>
/// <param name="source">instance to be parsed</param>
/// <param name="invoke">see <see cref="invoke"/></param>
/// <param name="old_to_new">generated to map <c>Key</c> <see cref="Fact.Id"/> of <paramref name="exposed"/> to corresponding <c>Value</c> <see cref="Fact.Id"/> of <paramref name="set"/></param>.
private static void FactOrganizerFromPublic(ref FactOrganizer set, PublicFactOrganizer exposed, bool invoke, out Dictionary<string, string> old_to_new)
/// <param name="old_to_new">generated to map <c>Key</c> <see cref="Fact.Id"/> of <paramref name="source"/> to corresponding <c>Value</c> <see cref="Fact.Id"/> of <paramref name="target"/></param>.
protected static void ReInitializeFactOrganizer(ref FactOrganizer target, FactOrganizer source, bool invoke, out Dictionary<string, string> old_to_new)
{
// TODO: other strategy needed when MMT save/load supported
// map old URIs to new ones
old_to_new = new Dictionary<string, string>();
// combine T:Fact to Fact
Dictionary<string, Fact> old_FactDict = new Dictionary<string, Fact>();
/*
FieldInfo[] finfos = typeof(PublicFactOrganizer).GetFields();
foreach(string type in PublicFactOrganizer.WatchedFacts)
AddListToDict(
finfos.First(x => x.Name.Remove(x.Name.Length-1) == type)
.GetValue(exposed)
as List<Fact>);
*/
AddListToDict(exposed.PointFacts);
AddListToDict(exposed.LineFacts);
AddListToDict(exposed.RayFacts);
AddListToDict(exposed.AngleFacts);
AddListToDict(exposed.OnLineFacts);
// initiate
set.invoke = invoke;
set.MaxLabelId = exposed.MaxLabelId;
set.UnusedLabelIds = exposed.UnusedLabelIds;
set.FactDict = new Dictionary<string, Fact>();
target.invoke = invoke;
target.MaxLabelId = source.MaxLabelId;
target.UnusedLabelIds = source.UnusedLabelIds;
target.FactDict = new Dictionary<string, Fact>();
// work Workflow
foreach (var sn in exposed.Workflow)
foreach (var sn in source.Workflow)
{
if (sn.creation)
// Add
{
Fact add;
if (old_to_new.ContainsKey(sn.Id))
add = set.FactDict[old_to_new[sn.Id]];
add = target.FactDict[old_to_new[sn.Id]];
else
{
Fact old_Fact = old_FactDict[sn.Id];
Fact old_Fact = source.FactDict[sn.Id];
add = old_Fact.GetType()
.GetConstructor(new Type[] { old_Fact.GetType(), old_to_new.GetType(), typeof(FactOrganizer) })
.Invoke(new object[] { old_Fact, old_to_new, set })
.Invoke(new object[] { old_Fact, old_to_new, target })
as Fact;
old_to_new.Add(sn.Id, add.Id);
}
set.Add(add, out _, sn.samestep);
target.Add(add, out _, sn.samestep);
}
else if (old_to_new.ContainsKey(sn.Id))
// Remove
{
Fact remove = set.FactDict[old_to_new[sn.Id]];
set.Remove(remove, sn.samestep);
Fact remove = target.FactDict[old_to_new[sn.Id]];
target.Remove(remove, sn.samestep);
}
}
// set un-redo state
while (set.backlog < exposed.backlog)
set.undo();
while (target.backlog < source.backlog)
target.undo();
set.soft_resetted = exposed.soft_resetted;
// === local functions ===
void AddListToDict<T>(List<T> list) where T : Fact
{
foreach (T ft in list)
old_FactDict.Add(ft.Id, ft);
}
target.soft_resetted = source.soft_resetted;
}
/// <summary>
......@@ -688,10 +679,8 @@ public void store(string name, List<Directories> hierarchie = null, bool use_ins
hierarchie.RemoveRange(hierarchie.Count - hierState.Count, hierState.Count);
// note: max depth for "this" is 2, since Fact has non-serilazible member, that is not yet ignored (see Fact.[JasonIgnore] and JSONManager.WriteToJsonFile)
// using public dummy class to circumvent deserialiation JsonInheritanceProblem (see todos @PublicFactOrganizer)
if (!exists || overwrite)
JSONManager.WriteToJsonFile(path, new PublicFactOrganizer(this), 0);
JSONManager.WriteToJsonFile(path, this);
path = path_o;
}
......@@ -707,8 +696,8 @@ public static bool load(ref FactOrganizer set, bool draw, string name, List<Dire
if (!loadable)
return false;
PublicFactOrganizer de_json = JSONManager.ReadFromJsonFile<PublicFactOrganizer>(path);
FactOrganizerFromPublic(ref set, de_json, draw, out old_to_new);
FactOrganizer de_json = JSONManager.ReadFromJsonFile<FactOrganizer>(path);
ReInitializeFactOrganizer(ref set, de_json, draw, out old_to_new);
set.path = path;
return true;
......@@ -869,149 +858,3 @@ public bool DynamiclySolved(
}
}
\ No newline at end of file
// TODO? PERF? SE? JsonInheritanceProblem: scrap this hardwired class and implement dynamic approach with JsonConverter (see: JSONManager.JsonInheritenceConverter)
/// <summary>
/// <see cref="JsonReader"/>/ <see cref="JsonWriter"/> readable and creatable format.
/// TODO? PERF? SE? JsonInheritanceProblem: scrap this hardwired class and implement dynamic approach with JsonConverter (see <see cref="JSONManager.JsonInheritenceConverter<T>"/>)
/// </summary>
public class PublicFactOrganizer : FactOrganizer
// public class exposing all protected members of FactOrganizer for JSON conversion
{
// TODO? check once if those are all with reflection
protected internal static List<string> WatchedFacts = new List<string>(new string[] {
"PointFact",
"LineFact",
"RayFact",
"OnLineFact",
"AngleFact"
});
public List<PointFact> PointFacts = new List<PointFact>();
public List<LineFact> LineFacts = new List<LineFact>();
public List<RayFact> RayFacts = new List<RayFact>();
public List<OnLineFact> OnLineFacts = new List<OnLineFact>();
public List<AngleFact> AngleFacts = new List<AngleFact>();
public new Dictionary<string, meta> MetaInf = new Dictionary<string, meta>();
public new List<stepnote> Workflow = new List<stepnote>();
// notes position in Workflow for un-/redo; the pointed to element is non-acitve
public new int marker = 0;
// backlock logic for convinience
public new int worksteps = 0;
public new int backlog = 0;
// set if recently been resetted
public new bool soft_resetted = false;
// InvokeEvents?
public new bool invoke;
// TODO? SE: better seperation
// Label Managment; Communicates with Facts
public new int MaxLabelId = 0;
public new SortedSet<int> UnusedLabelIds = new SortedSet<int>();
public new struct stepnote
{
// Fact.Id
public string Id;
// true if this Fact has been created in the same step as the last one
// steproot[false] (=> steptail[true])*
public bool samestep;
// reference to steproot/ after steptail-end
public int steplink;
// distincts creation and deletion
public bool creation;
public stepnote(string Id, bool samestep, int steplink, bool creation)
{
this.Id = Id;
this.samestep = samestep;
this.steplink = steplink;
this.creation = creation;
}
/*public stepnote(string Id, bool samestep, bool creation, PublicFactOrganizer that)
{
this.Id = Id;
this.samestep = samestep;
this.creation = creation;
if (samestep)
// steplink = !first_steptail ? previous.steplink : steproot
{
stepnote prev = that.Workflow[that.marker - 1];
this.steplink = prev.samestep ? prev.steplink : that.marker - 1;
}
else
// steproot sets steplink after itself (end of steptail)
this.steplink = that.marker + 1;
}*/
}
public new struct meta
{
// TODO? -> public int last_occurence for safe_dependencies
// reference to first occurrence in Workflow
public int workflow_id;
// keeps track wether Fact is currently in Scene
public bool active;
public meta(int workflow_id, bool active)
{
this.workflow_id = workflow_id;
this.active = active;
}
}
public PublicFactOrganizer()
{
FactDict = new Dictionary<string, Fact>();
this.invoke = false;
}
protected internal PublicFactOrganizer(FactOrganizer expose)
{
// expose all non-abstract members
marker = expose.marker;
worksteps = expose.worksteps;
backlog = expose.backlog;
soft_resetted = expose.soft_resetted;
invoke = expose.invoke;
MaxLabelId = expose.MaxLabelId;
UnusedLabelIds = expose.UnusedLabelIds;
foreach (var sn in expose.Workflow)
Workflow.Add(new stepnote(sn.Id, sn.samestep, sn.steplink, sn.creation));
foreach (var mt in expose.MetaInf)
MetaInf.Add(mt.Key, new meta(mt.Value.workflow_id, mt.Value.active));
// expose and deserialize all abstract members
foreach (var fc in expose.FactDict.Values)
// keys are Fact.Id
{
switch (fc.GetType().Name)
{
case "PointFact":
PointFacts.Add(fc as PointFact);
break;
case "LineFact":
LineFacts.Add(fc as LineFact);
break;
case "RayFact":
RayFacts.Add(fc as RayFact);
break;
case "OnLineFact":
OnLineFacts.Add(fc as OnLineFact);
break;
case "AngleFact":
AngleFacts.Add(fc as AngleFact);
break;
default:
throw new System.NotImplementedException();
}
}
}
}
\ No newline at end of file
......@@ -20,11 +20,6 @@ private const string
endingVal = "_val";
/// @}
/// <summary>
/// \copydoc FactOrganizer.path
/// Additional value for <see cref="ValidationSet"/>
/// </summary>
private string path_Val = null;
/// <summary>
/// \copydoc FactOrganizer.hierState
/// Additional value for <see cref="ValidationSet"/>
......@@ -130,6 +125,12 @@ public bool IsEmpty()
}
}
/// \copydoc FactOrganizer.FactOrganizer()
public SolutionOrganizer(): base()
{
ValidationSet = new List<SubSolution>();
}
/// \copydoc FactOrganizer.FactOrganizer(bool)
public SolutionOrganizer(bool invoke = false): base(invoke)
{
......@@ -151,20 +152,18 @@ public List<Fact> getMasterFactsByIndex (int i)
hierarchie ??= new List<Directories>();
hierarchie.AddRange(hierVal.AsEnumerable());
base.store(name + endingSol, hierarchie, use_install_folder, overwrite);
string path_o = path_Val;
path_Val = CreatePathToFile(out bool exists, name + endingVal, "JSON", hierarchie, use_install_folder);
string path_o = path;
path = CreatePathToFile(out bool exists, name + endingVal, "JSON", hierarchie, use_install_folder);
hierarchie.RemoveRange(hierarchie.Count - hierVal.Count, hierVal.Count);
if (exists && !overwrite)
{
path_Val = path_o;
path = path_o;
return;
}
JSONManager.WriteToJsonFile(path_Val, this.ValidationSet, 0);
path_Val = path_o;
JSONManager.WriteToJsonFile(path, this);
path = path_o;
}
public static bool load(ref SolutionOrganizer set, bool draw, string name, List<Directories> hierarchie = null, bool use_install_folder = false)
......@@ -173,33 +172,23 @@ public static bool load(ref SolutionOrganizer set, bool draw, string name, List<
hierarchie.AddRange(hierVal.AsEnumerable());
string path = CreatePathToFile(out bool loadable, name + endingVal, "JSON", hierarchie, use_install_folder);
if (!loadable)
{
hierarchie.RemoveRange(hierarchie.Count - hierVal.Count, hierVal.Count);
if (!loadable)
return false;
}
FactOrganizer save = StageStatic.stage.factState;
StageStatic.stage.factState = new SolutionOrganizer(false) as FactOrganizer;
loadable = FactOrganizer.load(ref StageStatic.stage.player_record.factState
, draw, name + endingSol, hierarchie, use_install_folder, out Dictionary<string, string> old_to_new);
SolutionOrganizer JsonTmp = JSONManager.ReadFromJsonFile <SolutionOrganizer> (path);
ReInitializeFactOrganizer(ref StageStatic.stage.player_record.factState, JsonTmp, draw, out Dictionary<string, string> old_to_new);
if (loadable)
{
set = (SolutionOrganizer)StageStatic.stage.factState;
set.path_Val = path;
}
set.path = path;
StageStatic.stage.factState = save;
hierarchie.RemoveRange(hierarchie.Count - hierVal.Count, hierVal.Count);
if (!loadable)
return false;
var JsonTmp = JSONManager.ReadFromJsonFile <List<SubSolution>> (path);
foreach (var element in JsonTmp)
foreach (var element in JsonTmp.ValidationSet)
// Parse and add
{
element.MasterIDs = new HashSet<string>(element.MasterIDs.Select(k => old_to_new[k]));
......@@ -212,8 +201,8 @@ public static bool load(ref SolutionOrganizer set, bool draw, string name, List<
public new void delete()
{
base.delete();
if (System.IO.File.Exists(path_Val))
System.IO.File.Delete(path_Val);
if (System.IO.File.Exists(path))
System.IO.File.Delete(path);
}
/// @}
}
......@@ -114,7 +114,7 @@ IEnumerator sendView(string endpoint)
{
string body = prepareScrollAssignments();
UnityWebRequest www = UnityWebRequest.Put(ServerAdress + endpoint, body);
using UnityWebRequest www = UnityWebRequest.Put(ServerAdress + endpoint, body);
www.method = UnityWebRequest.kHttpVerbPOST;
www.SetRequestHeader("Content-Type", "application/json");
var async = www.SendWebRequest();
......
......@@ -254,7 +254,7 @@ public static void RereadFileUWR(string pathfolders, string fileName, int toMain
string sourcePath = Path.Combine(Application.streamingAssetsPath, pathfolders);
sourcePath = Path.Combine(sourcePath, fileName);
var loadingRequest = UnityWebRequest.Get(sourcePath);
using var loadingRequest = UnityWebRequest.Get(sourcePath);
loadingRequest.SendWebRequest();
while (!loadingRequest.isDone)
{
......@@ -385,7 +385,7 @@ public static void RereadFileUW4(string pathfolders, string fileName, string des
string sourcePath = Path.Combine(Application.streamingAssetsPath, pathfolders);
sourcePath = Path.Combine(sourcePath, fileName);
var loadingRequest = UnityWebRequest.Get(sourcePath);
using var loadingRequest = UnityWebRequest.Get(sourcePath);
loadingRequest.SendWebRequest();
while (!loadingRequest.isDone)
{
......
......@@ -56,7 +56,7 @@ IEnumerator ServerRoutine()
{
UnityWebRequest request = UnityWebRequest.Get(CommunicationEvents.ServerAddressLocal + "/scroll/list");
using UnityWebRequest request = UnityWebRequest.Get(CommunicationEvents.ServerAddressLocal + "/scroll/list");
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.ConnectionError
|| request.result == UnityWebRequest.Result.ProtocolError)
......
......@@ -37,14 +37,13 @@ public class updateMouseCursor : MonoBehaviour
void Start()
{
setMouse();
}
private void Update()
{
setMouse();
}
}
public void setMouse()
......
{"category":"Demo Category","number":0,"name":"TechDemo A","description":"Tree Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{},"player_record":{}}
\ No newline at end of file
{"category":"Demo Category","number":0,"name":"TechDemo A","description":"Tree Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{},"player_record":{"solved":false,"date":-8585439463646016511,"seconds":0.0,"name":"TechDemo A_save"}}
\ No newline at end of file
{"category":"Demo Category","number":0,"name":"TechDemo B","description":"River Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{},"player_record":{}}
\ No newline at end of file
{"category":"Demo Category","number":0,"name":"TechDemo B","description":"River Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{},"player_record":{"solved":false,"date":-8585439463643952992,"seconds":0.0,"name":"TechDemo B_save"}}
\ No newline at end of file
fileFormatVersion: 2
guid: a751eddeb4588f44f83b26062e18ef32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
{"PointFacts":[{"Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact146","Label":"A","hasCustomLabel":false,"LabelId":1},{"Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact147","Label":"B","hasCustomLabel":false,"LabelId":2}],"LineFacts":[{"Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact146","Pid2":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact147","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact148","Label":"[AB]","hasCustomLabel":false,"LabelId":0}],"RayFacts":[],"OnLineFacts":[],"AngleFacts":[],"MetaInf":{"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact146":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact147":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact148":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact146","samestep":false,"steplink":3,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact147","samestep":true,"steplink":0,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact148","samestep":true,"steplink":0,"creation":true}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":false,"MaxLabelId":2,"UnusedLabelIds":[]}
\ No newline at end of file
fileFormatVersion: 2
guid: bcd408b32febdb349a56082aca96f36d
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
{"PointFacts":[{"Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","Label":"A","hasCustomLabel":false,"LabelId":1},{"Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","Label":"B","hasCustomLabel":false,"LabelId":2}],"LineFacts":[{"Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","Pid2":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151","Label":"[AB]","hasCustomLabel":false,"LabelId":0}],"RayFacts":[],"OnLineFacts":[],"AngleFacts":[],"MetaInf":{"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","samestep":false,"steplink":3,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","samestep":true,"steplink":0,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151","samestep":true,"steplink":0,"creation":true}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":false,"MaxLabelId":2,"UnusedLabelIds":[]}
\ No newline at end of file
fileFormatVersion: 2
guid: 34ecf0b680adf5646b4c1d9c99a01533
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c728017971edf724ebda5a064b672466
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 580fe9dede781264387b75a16475fb84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 15db50aef163ca140bd83ffd46dd85e2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 75770b352d605dd4eb408d8728296ab5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment