Firing a function across all objects of a class

Hi everyone,

First time I’ve have posted here, so feel free to include any etiquette things I might need too :slight_smile:

I have a project in which I have a class which extends monobehaviour, called Structure, and then additional classes which extend Structure, and are attached to game objects.

In my time manager (a separate class on a GameObject) I want to be able to fire a function across all the Structures for certain time related events - ie sunrise.

I’m not sure about the best way to do this, and it’s analogous to some other tasks ahead, so I thought I would ask the community for suggestions. I am using JS fwiw.

Thanks for your time

If you’re not going to store links to all your Structure objects, sounds like you need some sort of Broadcasting ability.
Quite a bit of info on that here.