How to check if an objects current material is the correct one?

what i’m trying to do is to check if an object’s material is the “orange” material i created.

public Material orange;
public Material thisMaterial;

// Start is called before the first frame update
void Start()
{
    thisMaterial = GetComponent<MeshRenderer>().material;
}

// Update is called once per frame
void Update()
{
    Debug.Log(thisMaterial);
    Debug.Log(orange);
}

private void OnMouseDown()
{
    if (thisMaterial == orange) //if current sprite is the neutral one
    {
        Debug.Log("material is orange");
    }
}

In the log they both show up as orange:

When I click the object, the “material is orange” message doesn’t show up in the console. What am i doing wrong?

public Material prefabMat;
private Material singleInstanceMat;
private Material sharedInstanceMat;

    private void Awake()
    {
        //singleInstanceMat= gameObject.GetComponent<MeshRenderer>().material;
        sharedInstanceMat = gameObject.GetComponent<MeshRenderer>().sharedMaterial;
    }

    private void Start()
    {
        Debug.Log(prefabMat == sharedInstanceMat ? true : false);
        //Debug.Log(prefabMat == singleInstanceMat? true : false);
    }

Here is the tip if you do not acsess the singleInstanceMat there is ok the sharedMaterial is keeping the material that you want. And the first debug returns TRUE. But when you acsess the normal .material the shared material is changeing i guess because of the instance.

I hope it will help