Help with Scripting (Boolean)

I have a public static bool open; which is set weather the door is open or not. This is required as two gameobjects use the script and this makes sure they both know if the doors open or not. It works.

However when I have multiple doors they all think they are either open or closed. Is there any way I can give the doors ID’s so in the inspector I could in each button put for e.g. 1. And then for another door and buttons 0.

Theoretically it would work, however I don’t know how to implement something like this. Im a expert in C# but that with software and I’m relativity new to unity.

give the gameobjects a script with a public variable like

public int doorID;

and then assign it in the inspector. Don’t use a static for that.