Magic Time Manager
v1.0
Last updated
Was this helpful?
v1.0
Last updated
Was this helpful?
Create an empty object, perhaps named "Magic Time Manager", and add the MagicTimeManager
component onto it. This holds instances which can be accessed by any (or ) object.
Populate this list with Local Time Scale Scriptable Objects you've created. Each will be replaced with a new instance of those objects, to keep from overwriting the default values on the Scriptable Objects.
At runtime, information about each LocalTimeScale
will be shown here, including the current value and the number of subscribers.
This way, all objects will be following the same instance, and share the same information.
This List<LocalTimeScale>
is populated automatically when you view the Magic Time Manager in the Inspector. It contains all of the Scriptable Objects in the project, so you can easily find them.
This is also used when the TimeScale()
method is called -- if the LocalTimeScale
has not been instanced yet, then the script will look it up in this list, before trying to create a new LocalTimeScale
object.
Other objects which inherit from or implement can "Subscribe to Initial TimeScales". When this happens, they subscribe to the instance assigned to the Magic Time Manager.
Don't forget to check out the page for more information on what you can do with this class.