Create a reference to a bool (or other variable) in the inspector

I’ve created a modular entity system, wherein each module of the entity has an associated array of ‘conditionals’, which are scriptable objects with an abstract function returning a bool. Is it possible to reference a bool within the inspector? For example, I might have a ‘stunned’ bool, or a ‘gamePaused’ bool, and I would want to be able to somehow reference and check the value of those bools. I am aware of ‘ref’ but don’t know how to extend this into the editor.

I want something similar to how you would drag in a transform, but rather be a reference to a bool. I want to then be able to read that bool, and have it so that if the bool changes in it’s local script, the conditional would update the changes. I also want this to be modular, so simply writing in script ‘if(entity.stunned)’ is not acceptable, because then I would need to create a new ‘conditional’ extension for each different bool. (one for if(gameManager.isPaused), another for if(entity.isAlive) etc)
_

A clarification if it isn’t clear:
I have bools in other classes that are updated in their own special ways. I want to be able to, through the editor, create a reference to that variable. If the player was stunned for example, a script would set entity.stunned = true. By storing a reference to the bool, an external class would (hopefully) also see the change, since I want to store a reference to the bool. A reference to the bool is not the same as making a new bool and setting it equal to the existing bool, since a change to the existing bool wouldn’t affect the new one. I want a reference, similar to how you would reference a class. You SET bools, ints and vectors, but you REFERENCE classes. I want to be able to REFERENCE a bool, int or vector, similar to how you would with the ‘ref’ function. But most importantly, I want to reference it through the inspector.
Sorry if this is more or less a reiteration, I’m just not sure how to better communicate my question…

No. In Java or C# you can’t have a reference to a value type. It’s a basic feature, built into the system. If you’ve used pointers in C++, then C# and Java seem very limited.

For a nice explanation, look up “boxing” in Java. It’s a hack where you make a class with one variable. Now you can have a reference to that class, which is like a reference to the variable.

This looks like something that could be accomplished by custom inspector script. Here is a link to a basic tutorial. Basic idea would be to create a bool field and in OnInspectorGUI method set this bool to whatever other bool you want, this way it will always have the same value as the bool in your object.