8 namespace droid.Runtime.Prototyping.Configurables {
12 [AddComponentMenu(ConfigurableComponentMenuPath._ComponentMenuPath
14 + ConfigurableComponentMenuPath._Postfix)]
15 [RequireComponent(typeof(Rigidbody))]
21 float _velocity_space = 0;
35 public override string PrototypingTypeName {
get {
return "RigidbodyConfigurable"; } }
40 get {
return this._angular_velocity; }
41 private set { this._angular_velocity = value; }
46 public float ObservationValue {
get {
return this._velocity_space; } }
48 public override ISpace ConfigurableValueSpace {
get; }
59 this._rigidbody = this.GetComponent<Rigidbody>();
60 this._vel_x = this.Identifier +
"VelX";
66 this.ParentEnvironment =
67 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._vel_x);
73 if (this.ParentEnvironment == null) {
77 this.ParentEnvironment.UnRegister(
this, this._vel_x);
87 if (this.SingleSpace._Decimal_Granularity >= 0) {
88 v = (int)Math.Round(v,
this.SingleSpace._Decimal_Granularity);
91 if (this.SingleSpace._Min_Value.CompareTo(
this.SingleSpace._Max_Value) != 0) {
93 if (v < this.SingleSpace._Min_Value || v > this.SingleSpace._Max_Value) {
94 Debug.Log(
string.Format(
"Configurable does not accept input{2}, outside allowed range {0} to {1}",
95 this.SingleSpace._Min_Value,
96 this.SingleSpace._Max_Value,
103 if (this.Debugging) {
104 Debug.Log(
"Applying " + v +
" To " + this.Identifier);
108 if (this.RelativeToExistingValue) {
override void RegisterComponent()
override Configuration [] SampleConfigurations()
override void UpdateCurrentConfiguration()
override void UnRegisterComponent()
override void ApplyConfiguration(IConfigurableConfiguration simulator_configuration)