10 namespace droid.Runtime.Prototyping.Actuators {
25 public float EnergySpendSinceReset {
26 get {
return this._energy_spend_since_reset; }
27 set { this._energy_spend_since_reset = value; }
32 public float EnergyCost {
get {
return this._energy_cost; }
set { this._energy_cost = value; } }
36 public override String PrototypingTypeName {
get {
return "Actuator"; } }
41 get {
return this._motion_value_space; }
42 set { this._motion_value_space = value; }
51 Debug.Log(
"Applying " + motion +
" To " + this.name);
55 if (motion.
Strength <
this.MotionSpace._Min_Value || motion.
Strength >
this.MotionSpace._Max_Value) {
56 Debug.LogWarning($
"It does not accept input {motion.Strength}, outside the allowed range from {this.MotionSpace._Min_Value} to {this.MotionSpace._Max_Value}");
62 this.InnerApplyMotion(motion);
63 this.EnergySpendSinceReset += Mathf.Abs(this.EnergyCost * motion.
Strength);
69 public virtual float GetEnergySpend() {
return this._energy_spend_since_reset; }
79 public virtual float Sample() {
return this.MotionSpace.Sample(); }
96 protected abstract void InnerApplyMotion(
IMotion motion);
102 public override string ToString() {
return this.Identifier; }
106 [Header(
"References", order = 99)]
110 [Header(
"General", order = 101)]
114 [SerializeField]
float _energy_spend_since_reset;
116 [SerializeField]
float _energy_cost;
override void RegisterComponent()
virtual float GetEnergySpend()
static Space1 MinusOneOne
void ApplyMotion(IMotion motion)
override string ToString()
override void UnRegisterComponent()