public void AdvanceDecay() { Decay = Mathf.Clamp(Decay + Time.deltaTime * DecayRate, 0.0f, 1.0f); HUD.Instance.SetProgressBarProgressDecay(Decay); DecayLevel = DecayValueToDecayLevel(Decay); }
public void AdvanceDecay() { Decay = Mathf.Clamp(Decay + Time.deltaTime * DecayRate, 0.0f, 1.0f); HUD.Instance.SetProgressBarProgressDecay(Decay); if (Decay < 0.3f) { if (DecayLevel != EDecayLevel.Fresh) { DecayLevel = EDecayLevel.Fresh; Debug.Log(this + " Decay Level Changed to: " + DecayLevel); } } else if (Decay < 0.6f) { DecayLevel = EDecayLevel.AlmostDone; Debug.Log(this + " Decay Level Changed to: " + DecayLevel); } else if (Decay < 0.99f) { if (DecayLevel != EDecayLevel.Medium) { DecayLevel = EDecayLevel.Medium; Debug.Log(this + " Decay Level Changed to: " + DecayLevel); } } else { if (DecayLevel != EDecayLevel.WellDone) { DecayLevel = EDecayLevel.WellDone; Debug.Log(this + " Decay Level Changed to: " + DecayLevel); } } }
public float DecayLevelToDecayValue(EDecayLevel level) { switch (level) { case EDecayLevel.Fresh: return(0); case EDecayLevel.Medium: return(TresholdMedium); case EDecayLevel.AlmostDone: return(TreshholdAlmostDone); case EDecayLevel.WellDone: return(TreshholdWellDone); } throw new NotImplementedException("No Implementation for this decay and difficulty."); }