/// <summary>Keeps result inside</summary> public Value multiply(ReadOnlyValue invalue, bool showMessageAboutNegativeValue = true) { if (invalue.get() < 0) { if (showMessageAboutNegativeValue) { Debug.Log("Value multiply failed"); } value = 0; } else { set(invalue.get() * this.get()); } return(this); }
/// <summary>Keeps result inside</summary> public Value Multiply(ReadOnlyValue howMuch, bool showMessageAboutNegativeValue = true) { //if (howMuch.get() < 0) //{ // if (showMessageAboutNegativeValue) // Debug.Log("Value multiply failed"); // value = 0; //} //else Set(howMuch.get() * get()); return(this); }
/// <summary>Keeps result inside</summary> public Value divide(ReadOnlyValue invalue, bool showMessageAboutNegativeValue = true) { if (invalue.get() <= 0) { if (showMessageAboutNegativeValue) { Debug.Log("Value divide failed"); } value = 99999; } else { set(this.value / (float)invalue.RawValue); } return(this); }
public Procent(ReadOnlyValue numerator, ReadOnlyValue denominator, bool showMessageAboutOperationFails = true) : this(numerator.get(), denominator.get(), showMessageAboutOperationFails) { }