// Update is called once per frame void Update() { if (state == State.WAIT && Time.time > nextPumpTime) { if (currentPumps >= pumpsToDrain) { SetPumpDone(); } else { SetPumpReady(); } } else if (state == State.PUMPIN) { if (!nozzle.IsPumping()) { ResetPump(); } } }