So i got this game object 1 which has a script that contains a class which is my “time controller” for my game, think about it as a DateTime structure (with hours, days, months years etc).
I have this other game object 2 which contains a script that has the class “City” on it, this class has properties like population, production etc. I want to make an event (either with UnityEvents or with classic c# events) so that for every hour that passes in the time controller, production or population will do x (in this case update its stats). Since i’m new to events i haven’t had luck with this, how would you go about this? i also dont really want to do this manually on the editor but rather through code, since this has to be scalable (the player will be able to make new cities, and said cities will have to automatically subscribe to the hourPassed event in the time controller).
Thanks