// Update is called once per frame void Update() { if (GameManager.isPaused) { return; } VerifyVictory(); currentSatisfaction -= VitesseReductionTemps * Time.deltaTime; currentSatisfaction = Mathf.Clamp(currentSatisfaction, 0, maxTemps); BarreSatisfaction.rectTransform.localScale = new Vector3(currentSatisfaction / maxTemps, 1, 1); instance.SatisfactionText.text = "Temps " + instance.currentSatisfaction.ToString("0") + "s";/* + "/" + instance.maxTemps.ToString("0");*/ currentPollution = Mathf.Clamp(currentPollution, 0, MaxPollution); BarrePollution.rectTransform.localScale = new Vector3(currentPollution / MaxPollution, 1, 1); if (ActualDrag) { Vector3 PositionCorrigé = Input.mousePosition; float MaxHeight = Screen.height / 2; if (PositionCorrigé.y > MaxHeight) { PositionCorrigé.y = MaxHeight; } ActualDrag.transform.position = PopUp.cam.ScreenToWorldPoint(PositionCorrigé); if (Input.GetKeyUp(KeyCode.Mouse0)) { ActualDrag.collider.enabled = true; if (CurrentPoubelle) { if (CurrentPoubelle.Type == ActualDrag.PoubelleAffilié) { currentPollution += ActualDrag.polutionEngendrée; PopUpPollution.enabled = true; PopUpPollution.text = "+" + ActualDrag.polutionEngendrée + "%"; CancelInvoke("effacerPopUpPollution"); Invoke("effacerPopUpPollution", 2); } else { currentPollution += ActualDrag.polutionEngendrée * 2 + 1; PopUpPollution.enabled = true; PopUpPollution.text = "+" + (ActualDrag.polutionEngendrée * 2 + 1) + "%"; CancelInvoke("effacerPopUpPollution"); Invoke("effacerPopUpPollution", 2); } ImageNoirPollution.color = new Color(0, 0, 0, currentPollution / MaxPollution * 1); FloatParameter satu = new FloatParameter(); satu.Override(-100 * (currentPollution / MaxPollution)); //satu.value = -100 * (currentPollution / MaxPollution); grading.saturation = satu; Debug.Log(satu.value); CurrentDéchets.Remove(ActualDrag); Destroy(ActualDrag.gameObject); } ActualDrag = null; SortDéchet(); } } }