Stopwatch on trigger enter

Hi, I’m new to Unity and I’m still learnig.
I made a little level where a ball has to reach the end before the timer reach the 0.
When the player reach the end a win screen appear and show you the score you have made and your time to complete the level.
What I want to know is: How can I stop the time in the winscreen after the player reached the end?

If they can be usefull down here there are the stopwatch script and the end trigger script:
Stopwatch:

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class stopwatch : MonoBehaviour
{
    public float timeStart = 0;
    public TextMeshProUGUI textBox;
    private bool isGameStarted = false;
    private bool gameEnded = false;

    // Start is called before the first frame update
    void Start()
    {
        textBox.text = timeStart.ToString();

    }

    // Update is called once per frame
    void Update()
    {

      
            timeStart += Time.deltaTime;
            Debug.Log(timeStart);
      
        textBox.text = Mathf.Round(timeStart).ToString();

        if (timeStart < 0)
        {
            timeStart = 0;
            isGameStarted = false;
            gameEnded = true;

        }

        if (gameEnded == true)
        {
            FindObjectOfType<Gamemanager>().EndGame();
          

        }
    }
}

Endtrigger:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Endtrigger : MonoBehaviour
{
    public  Gamemanager Gamemanager;
    public GameObject Scermatadicountdown;





    private void OnTriggerEnter(Collider other)
    {
        Scermatadicountdown.GetComponent<countdown>().enabled = false;
        Gamemanager.Completelevel();
    }
}

Hi,

Don’t increase timeStart everytime But only when gameEnded = False.
I guess…
EDIT : I maybe misunderstand your code but it seams that timeStart can’t be < 0,
since you add Time.deltaTime every frame (and starting at 0).

Hi,
Sorry for the late reply.
So what I’ve done to create the stopwatch script was literally copy and paste another script called countdown.
In that script when the timer reach the 0 appear the game over screen. Thats why there is the timeStart < 0.
To create the stopwatch script I’ve changed the" timeStart -= Time.deltaTime;" of the other script with the plus.