2 using System.Collections.Generic;
6 namespace droid.Runtime.Prototyping.Displayers.ScatterPlots {
11 [AddComponentMenu(DisplayerComponentMenuPath._ComponentMenuPath
12 +
"IndexedScatterPlot" 13 + DisplayerComponentMenuPath._Postfix)]
15 [SerializeField] GameObject[] _designs = null;
16 [SerializeField] List<GameObject> _instances = null;
21 protected override void Setup() { }
27 public override void Display(Double value) { }
29 public override void Display(
float[] values) { }
31 public override void Display(String values) { }
33 public override void Display(Vector3 value) {
throw new NotImplementedException(); }
34 public override void Display(Vector3[] value) { this.ScatterPlot(value); }
44 public override void Display(
float values) { }
47 if (this._RetainLastPlot) {
48 if (this._Values != null) {
49 PlotSeries(this._Values);
54 void SpawnDesign(GameObject design, Vector3 position, Quaternion rotation) {
56 var go = Instantiate(design, position, design.transform.rotation,
this.transform);
57 this._instances.Add(go);
64 protected override void Clean() {
65 if (Application.isPlaying) {
66 this._instances.ForEach(Destroy);
68 this._instances.ForEach(DestroyImmediate);
71 this._instances.Clear();
91 Debug.Log(
"Plotting value points");
95 this._Values = points;
98 foreach (var point
in points) {
99 var game_objects = this._designs;
100 if (game_objects != null && point._Val >= game_objects.Length) {
104 this.SpawnDesign(this._designs[(
int)point._Val], point._Pos, Quaternion.identity);
override void Display(Points.ValuePoint points)
override void Display(Vector3 value)
override void Display(Vector3[] value)
override void Display(Points.StringPoint[] points)
override void Display(Points.StringPoint point)
override void Display(float[] values)
override void Display(Points.ValuePoint[] points)
void ScatterPlot(Vector3[] points)
override void PlotSeries(Points.ValuePoint[] points)
override void Display(float values)
override void Display(String values)
override void Display(Double value)