Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
TextUpdater.cs
Go to the documentation of this file.
2 using UnityEngine;
3 using UnityEngine.UI;
4 
5 namespace droid.Runtime.Utilities.GameObjects.StatusDisplayer.EventRecipients {
9  [RequireComponent(typeof(Text))]
10  [ExecuteInEditMode]
11  public class TextUpdater : DataPoller {
14  [SerializeField]
15  Text _text;
16 
19  void Start() { this._text = this.GetComponent<Text>(); }
20 
25  public override void PollData(dynamic data) {
26  if (data is string) {
27  if (this._text) {
28  this._text.text = data;
29  }
30  }
31  }
32  }
33 }