Question by
Ambrose998800 · Dec 10, 2017 at 05:23 PM ·
c#variables
Shift variable value && values in between
Two simple questions, I just can't figure out right now by my own ( I try to make my scripts more elegant):
1: Is there a way to 'shift' a value over time, so that the value falls back at its origin value after that time, without using an else statement? Example:
bool ShiftValue;
Int Value = 2;
void Update()
{
while (ShiftValue == true)
{
Value++; //Value is 3 for now, but not constantly increasing
}
}
I need that to modify dynamic values that triggers thresholds. 2: Is there a simple way to define a value in between two limits, without using long expressions like:
if (BodyTemperature < 37.5f && BodyTemperature < 36.0f)
Something like: if (BodyTemperature 36.0f :: 38.0f)
Thx & Greetings
Comment