Exemplo n.º 1
0
    IEnumerator Spreading()
    {
        while (true)
        {
            yield return(new WaitForSeconds(1f));

            stacks -= 1f / stackDuration;

            if (stacks <= 0)
            {
                Stop();
                yield break;
            }

            visualScaler.SetScale(Mathf.Clamp01(stacks / maxStacks) * visualScaleMax * scaleMultiplier);

            float chance = Random.Range(0f, 1f) * stacks;
            if (chance >= 1 - spreadChance)
            {
                Spread();
            }
        }
    }
Exemplo n.º 2
0
    protected override void Update()
    {
        base.Update();

        _scaler.SetScale(curve.Evaluate(LifeFraction));
    }