Skip to content
Snippets Groups Projects
Commit a87a13b6 authored by John Schihada's avatar John Schihada
Browse files

Adjusted Text on Distance-Fact

parent b83d81bb
No related branches found
No related tags found
No related merge requests found
......@@ -63,9 +63,10 @@ public void SpawnPoint(PointFact fact)
public void SpawnLine(LineFact lineFact)
{
Vector3 point1 = (Facts[lineFact.Pid1] as PointFact).Point;
Vector3 point2 = (Facts[lineFact.Pid2] as PointFact).Point;
PointFact pointFact1 = (Facts[lineFact.Pid1] as PointFact);
PointFact pointFact2 = (Facts[lineFact.Pid2] as PointFact);
Vector3 point1 = pointFact1.Point;
Vector3 point2 = pointFact2.Point;
//Change FactRepresentation to Line
this.FactRepresentation = (GameObject)Resources.Load("Prefabs/Line", typeof(GameObject));
GameObject line = GameObject.Instantiate(FactRepresentation);
......@@ -85,8 +86,10 @@ public void SpawnLine(LineFact lineFact)
line.transform.GetChild(0).localScale = v3T;
line.transform.GetChild(0).rotation = Quaternion.FromToRotation(Vector3.right, point2 - point1);
string letter = ((Char)(64 + lineFact.Id + 1)).ToString();
line.GetComponentInChildren<TextMeshPro>().text = letter;
//string letter = ((Char)(64 + lineFact.Id + 1)).ToString();
//line.GetComponentInChildren<TextMeshPro>().text = letter;
line.GetComponentInChildren<TextMeshPro>().text = ((Char)(64 + pointFact1.Id + 1)).ToString() + ((Char)(64 + pointFact2.Id + 1)).ToString();
line.GetComponentInChildren<TextMeshPro>().text += " = " + Math.Round((point1-point2).magnitude, 2).ToString() + " m";
line.GetComponentInChildren<FactObject>().Id = lineFact.Id;
//If a new Line was spawned -> We are in CreateLineMode -> Then we want the collider to be disabled
if (CommunicationEvents.ActiveToolMode != ToolMode.ExtraMode)
......
......@@ -70,7 +70,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0.7}
m_SizeDelta: {x: 2, y: 0.5}
m_SizeDelta: {x: 4, y: 0.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &2096909858734684758
MeshRenderer:
......
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