Add custom properties to GameObjects

Hi all,
Is there a way of adding custom properties to GameObjects? Imagine you have a door with a trigger, when a player or an enemy walk into the trigger, the door opens. In the OnTriggerEnter event, I don’t want to check for the tag (enemies are tagged as enemy and the player is tagged as player), but I don’t want to have a lot of “if (isplayer || isenemy){}” in this case it’s just two, but what if there are dogs and cats and a lot of other different gameObjects that can open the door?
Ideally I’d like to be able to set “canOpenDoor = True;” to all those gameObjects and then in the trigger be able to do “if (gameObject.canOpenDoor)”;
Is there a way to do this without having to attach a script to all those gameObjects and then getComponent of to get a reference to that and check if it can open the door?
I’m asking for a general way of achieving this, the door example is just to explain the problem so please no answers like “You can tell the trigger to ignore this and that”.

Thanks

You might need to think about this a different way. Consider if ExecuteEvents or SendMessage could be used to do the job.

Really? I feel like this should be an option in unity. Being able to set arbitrary parameters to gameObjects and being able to read them when you have a reference to it. bool test = GameObject.customparameter;

The typical way to do this is the add a component and simply check for the presence or absence of the component (or an interface exposed by the component).

ExecuteEvents and the EventSystem stuff lets you check for the interfaces and call them with less effort. But you can roll your own system.

I see. That’s too bad, I think it’s something that would be incredibly useful in Unity