Check if destroyed without null

Hey, i wanna check if a GameObject got destroyed (Not in the same script that destroys the gameobject), but i can’t use null because there are always multiple of the same gameobject in the scene so null won’t work.
Here’s my current script :

public class Score : MonoBehaviour
{
    public int currentScore;
    public Text ScoreText;
    public GameObject Hexagon;  

  
    void Start()
    {
        ScoreText.text = "1";
    }

    void Update()
    {
        ScoreText.text = "Score : " + currentScore;

        [B]Here check if Hexagon GameObject got destroyed[/B]
            currentScore = currentScore + 1;
    }
}

Can you explain how this is relevant? Your score object has a reference to a single Hexagon object. You can check null and it will tell you if that particular object became null.

But I suspect what you’re actually interested in is finding out if any hexagon object in the scene was destroyed. Is that correct? If so, I recommend turning your Score object into a Singleton so that other scripts can access it. Then give it a method to notify it that a hexagon was destroyed, e.g. HexWasDestroyed() in which you increment the score. Then, attach a script to each hexagon object, and you can put an OnDestroy() method on that script in which you call Score.Instance.HexWasDestroyed().