Exemple #1
0
    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);
    }
Exemple #2
0
 void Awake()
 {
     score.SetValue(0);
     health.SetValue(health.maxValue);
     poison.ResetTickDamage();
     victoryScreen.gameObject.SetActive(false);
     defeatScreen.gameObject.SetActive(false);
 }
Exemple #3
0
 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);
        }
    }
Exemple #5
0
    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);
        }
    }
Exemple #6
0
 // Use this for initialization
 void Start()
 {
     Health.SetValue(1);
 }
Exemple #7
0
 public void ChangeVolume(float targetVolume)
 {
     _mixer.SetFloat("MasterVolume", Mathf.Log10(targetVolume) * 20);
     _currentVolume?.SetValue(Mathf.Log10(targetVolume) * 20);
 }
Exemple #8
0

        
Exemple #9
0
 // Use this for initialization
 void Start()
 {
     HealthLevel.SetValue(1.0f);
 }