Skip to content
Snippets Groups Projects
Commit 528fb656 authored by Richard Marcus's avatar Richard Marcus
Browse files

some tests

parent e89e3bab
No related branches found
No related tags found
No related merge requests found
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class RenderedScrollFact : MonoBehaviour
{
public int ID;
public TextMeshProUGUI LabelMesh;
private string _label;
public string Label
{
get { return _label; }
set
{
if (_label == value) return;
_label = value;
LabelMesh.text = value;
}
}
}
fileFormatVersion: 2
guid: 93aede1a33263ef44a354960618fe997
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1288409225757860898}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f459496b7a023cb4c849ddddad2c3fc0, type: 3}
m_Script: {fileID: 11500000, guid: 93aede1a33263ef44a354960618fe997, type: 3}
m_Name:
m_EditorClassIdentifier:
ID: 0
......
......@@ -41107,7 +41107,7 @@ PrefabInstance:
- target: {fileID: 2089306640899292912, guid: 4d99275c6663c25469ad3b65efcd4f5f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.000005722046
value: -0.0004994295
objectReference: {fileID: 0}
- target: {fileID: 2524590709578595355, guid: 4d99275c6663c25469ad3b65efcd4f5f,
type: 3}
......@@ -9,7 +9,7 @@ public class DropHandling : MonoBehaviour, IDropHandler
public Fact currentFact;
public void OnDrop(PointerEventData eventData){
var scrollFact = gameObject.GetComponent<ScrollFact>();
var scrollFact = gameObject.GetComponent<RenderedScrollFact>();
Debug.Log(eventData.pointerDrag.GetComponent<FactWrapper>().fact.Label+ " was dropped on "
+ gameObject.name+ " " +scrollFact.ID + "/" +
ScrollDetails.ParameterDisplays.Count+" label: "+scrollFact.Label);
......@@ -37,7 +37,7 @@ public void OnDrop(PointerEventData eventData){
// and also in facts
else
{
var affectedFact = ScrollDetails.ParameterDisplays[id.Key].GetComponentInChildren<ScrollFact>();
var affectedFact = ScrollDetails.ParameterDisplays[id.Key].GetComponentInChildren<RenderedScrollFact>();
string label = affectedFact.Label;
label = label.Remove(id.Value, 1);
label = label.Insert(id.Value, scrollFact.Label);
......
......@@ -63,7 +63,8 @@ public void setScroll(Scroll s)
{
var obj = Instantiate(parameterDisplayPrefab, Vector3.zero, Quaternion.identity, transform);
var scrollFact = obj.transform.GetChild(0).GetComponent<ScrollFact>();
var scrollFact = obj.transform.GetChild(0).GetComponent<RenderedScrollFact>();
scrollFact.ID = i;
//obj.GetComponent<RectTransform>().localPosition = GetPosition(i);
scrollFact.Label = Scroll.ParseString(i,s.requiredFacts[i].label,s.requiredFacts);
......
[
{
"problemTheory": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem",
"solutionTheory": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Solution",
"label": "OppositeLen",
"description": "Given a triangle $0$1$2 right angled at $2, the distance $0$1 can be computed from the angle at $1 and the distance $1$2",
"requiredFacts": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pA",
"label": "a",
"tp": {
"original": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
},
"simplified": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"label": "b",
"tp": {
"original": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
},
"simplified": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"label": "c",
"tp": {
"original": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
},
"simplified": {
"uri": "http://mathhub.info/MitM/core/geometry?3DGeometry?point",
"kind": "OMS"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pdistBC_v",
"label": "pdist$1$2_v",
"tp": {
"original": {
"uri": "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit",
"kind": "OMS"
},
"simplified": {
"uri": "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit",
"kind": "OMS"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pdistBC",
"label": "pdistt$1$2",
"tp": {
"original": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?DistanceFact?distanceFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pdistBC_v",
"kind": "OMS"
}
],
"kind": "OMA"
},
"simplified": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?DistanceFact?distanceFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pdistBC_v",
"kind": "OMS"
}
],
"kind": "OMA"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pangleABC_v",
"label": "pangleAt$0$1$2_v",
"tp": {
"original": {
"uri": "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit",
"kind": "OMS"
},
"simplified": {
"uri": "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit",
"kind": "OMS"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pangleABC",
"label": "pangle$0$1$2",
"tp": {
"original": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?AngleFact?angleFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pA",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pangleABC_v",
"kind": "OMS"
}
],
"kind": "OMA"
},
"simplified": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?AngleFact?angleFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pA",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pangleABC_v",
"kind": "OMS"
}
],
"kind": "OMA"
}
},
"df": null
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pangleBCA",
"label": "pangle$1$2$0",
"tp": {
"original": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?AngleFact?angleFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pA",
"kind": "OMS"
},
{
"float": 90.0,
"kind": "OMF"
}
],
"kind": "OMA"
},
"simplified": {
"applicant": {
"uri": "http://mathhub.info/FrameIT/frameworld?AngleFact?angleFact",
"kind": "OMS"
},
"arguments": [
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pB",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pC",
"kind": "OMS"
},
{
"uri": "http://mathhub.info/FrameIT/frameworld?OppositeLen_Problem?pA",
"kind": "OMS"
},
{
"float": 90.0,
"kind": "OMF"
}
],
"kind": "OMA"
}
},
"df": null
}
]
}
]
\ No newline at end of file
fileFormatVersion: 2
guid: 4069fe7e4a7672e47834935275b3aa8c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment