void Update() { if (_Time < _MaxTime && inside) { if (Input.GetButton("Accion")) { progressBar.BarraProgreso(_Time, _MaxTime); if (!audioPlaying) { paintEffect.Play(); audioPlaying = true; } particles.Play(); _Time += Time.deltaTime; float x = ((_Time * offsetMax) / _MaxTime); cuadro.Pintando(x); if (_Time >= _MaxTime) { cuadro.setPintado(); } } else { progressBar.Desactivar(); particles.Stop(false, ParticleSystemStopBehavior.StopEmitting); paintEffect.Stop(); } } else { progressBar.Desactivar(); particles.Stop(false, ParticleSystemStopBehavior.StopEmitting); paintEffect.Stop(); audioPlaying = false; } }