/// <summary> Resets the current Value to the set reset value. The reset happens instantly if instantUpdate is passed as TRUE </summary> /// <param name="resetValue"> Target reset value </param> /// <param name="instantUpdate"> If TRUE, the value will not get animated and be changed instantly </param> public void ResetValueTo(ResetValue resetValue, bool instantUpdate) { switch (resetValue) { case ResetValue.ToMinValue: if (DebugComponent) { DDebug.Log("[" + name + "] Resetting Value to MinValue: " + MinValue, this); } SetValue(MinValue, instantUpdate); break; case ResetValue.ToMaxValue: if (DebugComponent) { DDebug.Log("[" + name + "] Resetting Value to MaxValue: " + MaxValue, this); } SetValue(MaxValue, instantUpdate); break; case ResetValue.ToCustomValue: if (DebugComponent) { DDebug.Log("[" + name + "] Resetting Value to CustomResetValue: " + CustomResetValue, this); } SetValue(CustomResetValue, instantUpdate); break; } OnValueUpdated(); }
/// <summary> Resets the current Value to the set reset value instantly </summary> /// <param name="resetValue"> Target reset value </param> public void ResetValueTo(ResetValue resetValue) { ResetValueTo(resetValue, true); }