Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
CurriculumManager.cs
Go to the documentation of this file.
1 using System;
4 using UnityEngine;
5 
6 namespace droid.Runtime.Managers.Experimental {
7  [AddComponentMenu("Neodroid/Managers/NotUsed/Curriculum")]
9  [SerializeField] Curriculum _curriculum = null;
10 
11  [SerializeField] bool _draw_levels = false;
12 
13  public Curriculum Curriculum1 { get { return this._curriculum; } set { this._curriculum = value; } }
14 
15  public Boolean DrawLevels { get { return this._draw_levels; } set { this._draw_levels = value; } }
16 
17  #if UNITY_EDITOR
18  void OnDrawGizmosSelected() {
19  if (this._draw_levels) {
20  var i = 0;
21  var len = this._curriculum._Levels.Length;
22  foreach (var level in this._curriculum._Levels) {
23  if (level._Configurable_Entries != null && level._Configurable_Entries.Length > 0) {
24  var frac = i++ / (float)len;
25  foreach (var entry in level._Configurable_Entries) {
26  var configurable = GameObject.Find(entry._Configurable_Name);
27  if (configurable != null) {
28  Gizmos.color = new Color(frac, 0, 1 - frac, 0.1F);
29  var position = configurable.transform.position;
30  Gizmos.DrawSphere(position, entry._Max_Value);
31  Gizmos.color = new Color(1, 1, 1, 0.4F);
32  Gizmos.DrawWireSphere(position, entry._Max_Value);
33  var pos_up = position;
34  pos_up.y += entry._Max_Value;
35  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_up, new Color(1, 1, 1, 1));
36  var pos_left = position;
37  pos_left.x += entry._Max_Value;
38  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_left, new Color(1, 1, 1, 1));
39  var pos_forward = position;
40  pos_forward.z += entry._Max_Value;
41  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_forward, new Color(1, 1, 1, 1));
42  var pos_down = position;
43  pos_down.y -= entry._Max_Value;
44  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_down, new Color(1, 1, 1, 1));
45  var pos_right = position;
46  pos_right.x -= entry._Max_Value;
47  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_right, new Color(1, 1, 1, 1));
48  var pos_backward = position;
49  pos_backward.z -= entry._Max_Value;
50  NeodroidDrawingUtilities.DrawString(i.ToString(), pos_backward, new Color(1, 1, 1, 1));
51  }
52  }
53  }
54  }
55  }
56  }
57  #endif
58  }
59 }