void burn(float speed) { if (!isburning) { isburning = true; Particle.Play(); spriteRenderer.color = new Color(255f, 255f, 255f, 0); } if (currentFuel > 0)//update burn { currentFuel = currentFuel - Time.deltaTime * speed; float size = UtilityFun.Mapping(currentFuel, 0f, BurningFuel, 0f, 0.45f); ParticleSystem.MainModule main = Particle.main; main.startSize = size; } else // stop burn { ResetBurn(); } }
void Update() { float growValue = UtilityFun.Mapping(RainValue, RainMinValue, RainMaxValue, 0, 1); animator.Play("Tree01", 0, growValue); }