Can't change property for only one type of GameObject.

I have one prefab called Cell. Inside a Cell I have four game objects: Flag, Button,Text and Background. I’m trying to modify visibility of Flag from Button’s script component when user click right mouse button. Instead of one discovered flag I got all discovered flags. Here is code:

public class ButtonControler : MonoBehaviour
{
    public Sprite Normal;
    public Sprite Over;
    
    private SpriteRenderer _spriteRenderer;
    private FlagControler _flagControler;
    private bool _isDiscovered;
    void Start()
    {
        _spriteRenderer = GetComponent<SpriteRenderer>();
        _flagControler = transform.parent.GetChild(0).GetComponent<FlagControler>();
    }

    private void OnMouseEnter()
    {
        if (!_isDiscovered)
        {
            _spriteRenderer.sprite = Over;
        }
    }

    private void OnMouseExit()
    {
        if (!_isDiscovered)
        {
            _spriteRenderer.sprite = Normal;
        }
    }

    private void Update()
    {
        if (Input.GetMouseButtonDown(1))
        {
            // This code discovers all Flags instead of only one.
            _flagControler.IsVisible = !_flagControler.IsVisible;
        }
        else if (Input.GetMouseButtonDown(0) && !_flagControler.IsVisible)
        {
            _spriteRenderer.sprite = null;
            _isDiscovered = true;
            // TODO: raise an event
        }
    }
}

And here is Script attached to the Flag:

public class FlagControler : MonoBehaviour
{
    public Sprite Texture;
    public bool IsVisible
    {
        get
        {
            return _isVisible;
        }
        set
        {
            if (_isVisible != value)
            {
                _isVisible = value;

                if (_isVisible)
                {
                    _spriteRenderer.sprite = Texture;
                }
                else
                {
                    _spriteRenderer.sprite = null;
                }
            }
        }
    }

    private bool _isVisible;
    private SpriteRenderer _spriteRenderer;

    void Start()
    {
        _spriteRenderer = GetComponent<SpriteRenderer>();
        _spriteRenderer.sprite = null;
    }
}

the problem is on the Update of ButtonControler, if you check GetMouseButtonDown this becomes true on all instances of the script, you need also check if this is the instance that you are hovering, since you have change the sprite of this particular gameObject, I will check if it is Over, to improve this add a global variable bool hovering and modify it on OnMouseEnter() and OnMouseExit()

 private void Update()
 {
     if (Input.GetMouseButtonDown(1)   && _spriteRenderer.sprite == Over)
     {
         // This code discovers all Flags instead of only one.
         _flagControler.IsVisible = !_flagControler.IsVisible;
     }
     else if (Input.GetMouseButtonDown(0) && !_flagControler.IsVisible)
     {
         _spriteRenderer.sprite = null;
         _isDiscovered = true;
         // TODO: raise an event
     }
 }

to improve it even more try OnMouseDown