private void Update() { currentPower.ApplyChange(ReplenishmentCurve.Value.Evaluate((currentPower.Value / maxPower.Value)) * Time.deltaTime); if (currentPower.Value > maxPower.Value) { currentPower.SetValue(maxPower.Value); } /*print(ReplenishmentCurve.Value.Evaluate( * (currentPower / maxPower)) * Time.deltaTime);*/ //print("Current Power = " + currentPower.Value); }
void Awake() { score.SetValue(0); health.SetValue(health.maxValue); poison.ResetTickDamage(); victoryScreen.gameObject.SetActive(false); defeatScreen.gameObject.SetActive(false); }
public void FinishActivation() { if (returnToDefaultOnEnd) { affectedBoolData?.SetValue(_defaultBoolValue); if (IsNumerical) { affectedFloatData.SetValue(_defaultNumberValue); } } isFinished = true; Debug.Log($"Finishing: {powerName}"); }
private void UpdateVariables() { if (_isImmortalityActive) { PlayerHP.SetValue(MaxPlayerHP.Value); } if (_isInfiniteAmmoActive) { CurrentAmmo.SetValue(MaxAmmo.Value); } if (_isMaxThunderActive) { CurrentThunderPower.SetValue(MaxThunderPower.Value); } }
public void EvaluatePower() { float rad = 0; float amm = 0; float dmg = 0; float currTime = currentPower.Value / maxPower.Value; if (!readRadiusKeysDirectly) { rad = radiusCurve.Value.Evaluate(currTime); } else { rad = GetNearestLowerKey(radiusCurve, currTime); } if (!readAmmoKeysDirectly) { amm = ammoCurve.Value.Evaluate(currTime); } else { amm = GetNearestLowerKey(ammoCurve, currTime); } if (!readDamageKeysDirectly) { dmg = damageCurve.Value.Evaluate(currTime); } else { dmg = GetNearestLowerKey(damageCurve, currTime); } currentAmmo.SetValue((int)amm); currentRadius.SetValue(rad); currentDamage.SetValue(dmg); lastSpentPower.SetValue(currentPower.Value); //print("From Power: Radius - " + rad ); if (consumeOnUse) { currentPower.SetValue(0); } }
// Use this for initialization void Start() { Health.SetValue(1); }
public void ChangeVolume(float targetVolume) { _mixer.SetFloat("MasterVolume", Mathf.Log10(targetVolume) * 20); _currentVolume?.SetValue(Mathf.Log10(targetVolume) * 20); }
// Use this for initialization void Start() { HealthLevel.SetValue(1.0f); }