12 namespace droid.Runtime.Prototyping.Displayers {
26 protected bool _RetainLastPlot =
true;
31 protected dynamic _Values = null;
33 [SerializeField]
bool clean_all_children =
true;
34 [SerializeField]
bool clean_before_every_plot =
true;
41 bool _PlotRandomSeries =
false;
43 [SerializeField]
bool always_random_sample_new =
true;
49 get {
return this._environment; }
50 set { this._environment = value; }
56 public override string PrototypingTypeName {
get {
return "Displayer"; } }
62 this.ParentEnvironment =
63 NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
this);
74 if (this._RetainLastPlot) {
75 if (this.clean_before_every_plot) {
79 if (this._Values != null) {
80 PlotSeries(this._Values);
86 void OnDrawGizmosSelected() {
87 if (this.enabled && Selection.activeGameObject ==
this.gameObject) {
88 if (!this._PlotRandomSeries && !this._RetainLastPlot) {
92 if (this._Values == null || this._Values.Length == 0 ||
this.always_random_sample_new) {
93 if (this._PlotRandomSeries) {
95 var vs = PlotFunctions.SampleRandomSeries(9);
96 this._Values = vs.Select(v => v._Val).ToArray();
111 if (this.clean_all_children) {
112 foreach (Transform child
in this.transform) {
113 if (Application.isPlaying) {
114 Destroy(child.gameObject);
116 DestroyImmediate(child.gameObject);
121 if (this._RetainLastPlot) {
126 void OnDestroy() { this.Clean(); }
128 void OnDisable() { this.Clean(); }
130 void OnEnable() { this.Clean(); }
138 public abstract void Display(Single value);
143 public abstract void Display(Double value);
148 public abstract void Display(Single[] values);
153 public abstract void Display(String value);
158 public abstract void Display(Vector3 value);
163 public abstract void Display(Vector3[] value);
override void UnRegisterComponent()
override void RegisterComponent()