// Update is called once per frame void Update() { if (isRepairing) { timePassed += Time.deltaTime; timeSlider.value = timePassed; if (timePassed >= repairTime) { isRepairing = false; assignedCrew.retireCrew(); Destroy(this.gameObject); } } else { GameManager.instance.giveDamage(damagesSecons * Time.deltaTime); } }