A class in Root.Township, the global namespace.
Component holding a float that inspector events can add to, subtract from, multiply, divide or set, firing changed after each change.
Constructors
| Member | What it is |
|---|
OperatedValue() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|
private FloatEvent changed | Event fired with the new value after every operation. |
Properties
| Member | What it is |
|---|
float Value { get; private set; } | The current value. Starts at 0 and isn't saved. |
Methods
| Member | What it is |
|---|
void Add(float amount) | Adds the amount to Value and fires changed. |
void Divide(float amount) | Meant to divide, but the code subtracts the amount from Value, then fires changed. |
void Multiply(float amount) | Multiplies Value by the amount and fires changed. |
void Set(float value) | Sets Value and fires changed. |
void Subtract(float amount) | Subtracts the amount from Value and fires changed. |