Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
 /// <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);
 }
Exemple #4
0
 public Procent(ReadOnlyValue numerator, ReadOnlyValue denominator, bool showMessageAboutOperationFails = true)
     : this(numerator.get(), denominator.get(), showMessageAboutOperationFails)
 {
 }