Skip to content
Snippets Groups Projects
Commit 459d656e authored by MaZiFAU's avatar MaZiFAU
Browse files

Reactivatet scroll/list; updated scroll.json; updated StreamingAssets; Refactor AlignText; -

parent cdd11988
No related branches found
No related tags found
No related merge requests found
Showing
with 79826 additions and 54760 deletions
......@@ -80,43 +80,43 @@ IEnumerator _GetScrollsfromServer()
//UnityWebRequest request = UnityWebRequest.Get("https://019a8ea5-843a-498b-8d0c-778669aef987.mock.pstmn.io/get");
System.DateTime requestTime = System.DateTime.UtcNow;
//UnityWebRequest request = null;
//for (int i = 0; i < this.tryScrollListTimes; i++)
//{
// request = UnityWebRequest.Get(CommunicationEvents.ServerAdress + "/scroll/list");
// request.method = UnityWebRequest.kHttpVerbGET;
// yield return request.SendWebRequest();
// if (request.result == UnityWebRequest.Result.ConnectionError
// || request.result == UnityWebRequest.Result.ProtocolError)
// {
// Debug.LogWarning(request.error);
// Debug.Log("GET Scroll/list failed. Attempt: " + (i + 1).ToString());
// }
// else
// break;
//}
//while (request.result == UnityWebRequest.Result.InProgress)
// yield return null;
UnityWebRequest request = null;
for (int i = 0; i < this.tryScrollListTimes; i++)
{
request = UnityWebRequest.Get(CommunicationEvents.ServerAdress + "/scroll/list");
request.method = UnityWebRequest.kHttpVerbGET;
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.ConnectionError
|| request.result == UnityWebRequest.Result.ProtocolError)
{
Debug.LogWarning(request.error);
Debug.Log("GET Scroll/list failed. Attempt: " + (i + 1).ToString());
}
else
break;
}
while (request.result == UnityWebRequest.Result.InProgress)
yield return null;
System.DateTime answerTime = System.DateTime.UtcNow;
string jsonString = null;
//if (request.result == UnityWebRequest.Result.ConnectionError
// || request.result == UnityWebRequest.Result.ProtocolError)
//{
// Debug.LogWarning(request.error);
//}
//else
//{
// CommunicationEvents.ServerRunning = true;
// while (!request.downloadHandler.isDone)
// yield return null;
// jsonString = request.downloadHandler.text;
//}
if (request.result == UnityWebRequest.Result.ConnectionError
|| request.result == UnityWebRequest.Result.ProtocolError)
{
Debug.LogWarning(request.error);
}
else
{
CommunicationEvents.ServerRunning = true;
while (!request.downloadHandler.isDone)
yield return null;
jsonString = request.downloadHandler.text;
}
if (string.IsNullOrEmpty(jsonString)
|| jsonString.Equals("[]"))
......
using System.Collections;
using UnityEngine;
//using UnityEngine.EventSystems;
using static UIconfig;
public class AlignText : MonoBehaviour
{
// Start is called before the first frame update
private Camera Cam;
public Camera Cam1;
public Camera Cam2;
public Camera BackUPCam;
// public GameObject Moving_GObj;
void Start()
{
StartCoroutine(CheckForNewMainCamRoutine());
}
// Update is called once per frame
void Update()
{
//print("Cam" + Cam);
//CheckForNewMainCamRoutine();
if (Cam == null) { return; }
if (Cam == null)
return;
transform.forward = Cam.transform.forward;
//Not yet the perfect solution
//Problem is the relative rotation of the TextMesh to the Line-Parent
//transform.rotation = Quaternion.Lerp(transform.parent.transform.rotation, Cam.transform.rotation, 0);
//if (Moving_GObj) { }
//TODO: this should be done via event system when controlMode is changed; not every Frame!
//Überprüfen ob Textfeld einen Collider hat, und wenn ja dieser aktiv sein soll
if (gameObject.GetComponent<BoxCollider>() != null)
if (gameObject.TryGetComponent(out BoxCollider boxCollider))
{
if (UIconfig.controlMode == ControlMode.Keyboard) { gameObject.GetComponent<BoxCollider>().enabled = false; }
if (UIconfig.controlMode == ControlMode.Mobile) { gameObject.GetComponent<BoxCollider>().enabled = true; }
if (UIconfig.controlMode == UIconfig.ControlMode.Keyboard)
boxCollider.enabled = false;
if (UIconfig.controlMode == UIconfig.ControlMode.Mobile)
boxCollider.enabled = true;
}
}
......@@ -53,30 +43,15 @@ Camera toCamMain()
return Camera.main;
}
IEnumerator CheckForNewMainCamRoutine()
{
yield return new WaitForSeconds(0);//Verzögerung für Bug aufhebung hinzugefügt, Bug selbst aktuell vergessen
switch (UIconfig.MainCameraID)
Cam = UIconfig.MainCameraID switch
{
case 0:
Cam = toCamMain();
break;
case 1:
Cam = Cam1;
break;
case 2:
Cam = Cam2;
break;
default:
Cam = toCamMain();
break;
0 => toCamMain(),
1 => Cam1,
2 => Cam2,
_ => toCamMain(),
};
}
//StopCoroutine(CheckForNewMainCamRoutine());
//print("Stopped:CheckForNewMainCamRoutine()");
//Cam = Camera.main;
}
}
......@@ -333,6 +333,8 @@ string prepareScrollAssignments()
private void processScrollDynamicInfo(ScrollDynamicInfo scrollDynamicInfo)
{
//TODO: more hints available in scrollDynamicInfo.rendered.requiredFacts
LatestBackwartsCompletions = scrollDynamicInfo.backward_completions.Count > 0
? scrollDynamicInfo.backward_completions[0]
: new List<ScrollAssignment>();
......
fileFormatVersion: 2
guid: ce8e4f40f12811b41b4eb2c1b7b6ece7
guid: 82a2bc667aa1ebf46bb2a36bd51324cb
TextScriptImporter:
externalObjects: {}
userData:
......
fileFormatVersion: 2
guid: 5eea08c14507fec4c94d684de8fa90d4
guid: ff0a7c5092a226b4fadb8e48adb580b4
TextScriptImporter:
externalObjects: {}
userData:
......
This diff is collapsed.
fileFormatVersion: 2
guid: e91cf6d7f4d81bb46a18a46e0788afd4
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -16,6 +16,7 @@
}
],
"ExposedSolutionFacts": [],
"ScrollOverwrites": {},
"ImmutableFacts": [],
"WorkflowGadgetDict": {
"-1": null
......@@ -46,7 +47,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact2",
......@@ -56,7 +57,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact3",
......@@ -66,7 +67,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
}
],
"marker": 3,
......@@ -93,11 +94,7 @@
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1"
},
"Label": "A",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 1
},
......@@ -124,11 +121,7 @@
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact2"
},
"Label": "B",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 2
},
......@@ -143,11 +136,7 @@
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact3"
},
"Label": "[AB]",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 0
}
......@@ -155,6 +144,7 @@
"name": null,
"path": null
},
"record_index": null,
"solution_approches": [],
"AllowedScrolls": null,
"AllowedGadgets": null,
......
fileFormatVersion: 2
guid: 06d0d19df08933a4a8846351bb46ea37
guid: 195df17949e85d146a570194f168bf07
TextScriptImporter:
externalObjects: {}
userData:
......
......@@ -34,6 +34,7 @@
}
],
"ExposedSolutionFacts": [],
"ScrollOverwrites": {},
"ImmutableFacts": [],
"WorkflowGadgetDict": {
"-1": null
......@@ -64,7 +65,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact5",
......@@ -74,7 +75,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact6",
......@@ -84,7 +85,7 @@
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.9207362000000785
"GadgetTime": 0.0
}
],
"marker": 3,
......@@ -111,11 +112,7 @@
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact4"
},
"Label": "A",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 1
},
......@@ -142,11 +139,7 @@
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact5"
},
"Label": "B",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 2
},
......@@ -161,11 +154,7 @@
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"ServerDefinition": {
"kind": "OMS",
"uri": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact6"
},
"Label": "[AB]",
"_CustomLabel": null,
"hasCustomLabel": false,
"LabelId": 0
}
......@@ -173,6 +162,7 @@
"name": null,
"path": null
},
"record_index": null,
"solution_approches": [],
"AllowedScrolls": [
"http://mathhub.info/FrameIT/frameworld?OppositeLen"
......
fileFormatVersion: 2
guid: ae1880b5e2f44cf479c0c5e6f94d37ba
guid: a5dd57ea3c70d7741a8140588e416068
TextScriptImporter:
externalObjects: {}
userData:
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment