Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
TextMeshDisplayer.cs
Go to the documentation of this file.
1 using System;
3 using UnityEngine;
4 
5 #if TEXT_MESH_PRO_EXISTS
6 using TMPro;
7 
8 namespace droid.Neodroid.Prototyping.Displayers {
12  [ExecuteInEditMode]
13  [AddComponentMenu(
14  DisplayerComponentMenuPath._ComponentMenuPath + "TextMesh" + DisplayerComponentMenuPath._Postfix)]
15  public class TextMeshDisplayer : Displayer {
19  TextMeshPro _text;
20 
24  protected override void Setup() { this._text = this.GetComponent<TextMeshPro>(); }
25 
30  public void SetText(string text) {
31  #if NEODROID_DEBUG
32  if (this.Debugging) {
33  Debug.Log("Applying " + text + " To " + this.name);
34  }
35  #endif
36 
37  this._text.SetText(text);
38  }
39 
45  public override void Display(float value) { throw new NotImplementedException(); }
46 
52  public override void Display(Double value) { throw new NotImplementedException(); }
53 
59  public override void Display(float[] values) { throw new NotImplementedException(); }
60 
65  public override void Display(String value) {
66  #if NEODROID_DEBUG
67  if (this.Debugging) {
68  Debug.Log("Applying " + value + " To " + this.name);
69  }
70  #endif
71 
72  this.SetText(value);
73  }
74  }
75 }
76 #else
77 namespace droid.Runtime.Prototyping.Displayers {
80  [ExecuteInEditMode]
81  [AddComponentMenu("Neodroid/Displayers/TextMesh")]
82  public class TextMeshDisplayer : Displayer {
84  protected override void Setup() {
85  Debug.Log("TextMeshPro is not defined in project, add 'TEXT_MESH_PRO_EXISTS' to your unity projects 'define symbols' under the player settings or '-define:TEXT_MESH_PRO_EXISTS' in mcs.rsp to enable TextMeshPro displayer integration");
86  }
87 
91  public void SetText(string text) {
92  #if NEODROID_DEBUG
93  if (this.Debugging) {
94  Debug.Log("Applying " + text + " To " + this.name);
95  }
96  #endif
97  }
98 
99  //public override void Display(Object o) { throw new NotImplementedException(); }
100 
105  public override void Display(float value) { throw new NotImplementedException(); }
106 
111  public override void Display(Double value) { throw new NotImplementedException(); }
112 
117  public override void Display(float[] values) { throw new NotImplementedException(); }
118 
122  public override void Display(String value) {
123  #if NEODROID_DEBUG
124  if (this.Debugging) {
125  Debug.Log("Applying " + value + " To " + this.name);
126  }
127  #endif
128  this.SetText(value);
129  }
130 
131  public override void Display(Vector3 value) { throw new NotImplementedException(); }
132  public override void Display(Vector3[] value) { throw new NotImplementedException(); }
133 
134  public override void Display(Points.ValuePoint points) { throw new NotImplementedException(); }
135 
136  public override void Display(Points.ValuePoint[] points) { throw new NotImplementedException(); }
137 
138  public override void Display(Points.StringPoint point) { throw new NotImplementedException(); }
139  public override void Display(Points.StringPoint[] points) { throw new NotImplementedException(); }
140  public override void PlotSeries(Points.ValuePoint[] points) { throw new NotImplementedException(); }
141  }
142 }
143 #endif
override void Display(Points.StringPoint point)
override void Display(Points.ValuePoint[] points)
override void Display(Points.ValuePoint points)
override void PlotSeries(Points.ValuePoint[] points)
override void Display(Points.StringPoint[] points)