activating multiple voids with the same name trough one line

I have multiple objects in my scene who need to act on their bools (so if bool = true then activate code)
this code only has to be run once so doing it on “void update” is overkill and will lag my pc. so my idea was to make my own command which is: “public void UpdateBool”
but I will have this void command in every object. will one activation of the void command run it in every object?
or is there a better way?

public bool m_activationbool=false;

    private void Update()
        if (m_activationbool==true && this.gameObject.activeSelf==false)

No you just have to access that gameobject’s script and turn on bool value and code will run only one time.