Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
StringAugmentedCameraSensor.cs
Go to the documentation of this file.
1 using System;
5 using UnityEngine;
6 
7 namespace droid.Runtime.Prototyping.Sensors.Camera.Deprecated {
11  [AddComponentMenu(SensorComponentMenuPath._ComponentMenuPath
12  + "StringAugmentedCamera"
13  + SensorComponentMenuPath._Postfix)]
14  [ExecuteInEditMode]
15  [RequireComponent(typeof(UnityEngine.Camera))]
17  IHasString {
18  const string _color_identifier = "Colors";
19 
20  string _colors;
21 
24  [Header("Observation", order = 103)]
25  [SerializeField]
26  protected string serialisedString;
27 
30  public String ObservationValue { get { return this.serialisedString; } }
31 
35  protected override void PreSetup() {
36  base.PreSetup();
37  this._colors = this.Identifier + _color_identifier;
38  }
39 
43  protected override void RegisterComponent() {
44  this.ParentEnvironment =
45  NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
46  this,
47  this.Identifier);
48 
49  this.ParentEnvironment =
50  NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
51  this,
52  this._colors);
53  }
54 
58  protected override void UnRegisterComponent() {
59  this.ParentEnvironment?.UnRegister(this, this.Identifier);
60  this.ParentEnvironment?.UnRegister(this, this._colors);
61  }
62 
66  public override void UpdateObservation() {
67  base.UpdateObservation();
68  this.serialisedString = "";
69  }
70  }
71 }