> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/magic-time-local-time-scale/magic-time-manager.md).

# Magic Time Manager

v1.0

Create an empty object, perhaps named "Magic Time Manager", and add the `MagicTimeManager` component onto it. This holds [`LocalTimeScale`](/magic-pig-games/magic-time-local-time-scale/local-time-scale.md) instances which can be accessed by any [`IUseMagicTime`](/magic-pig-games/magic-time-local-time-scale/magic-time-user/ihavelocaltime.md) (or [`MagicTimeUser`](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md)) object.

<figure><img src="https://2431624982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MY3N_li2jPq7az6mYfq%2Fuploads%2FNU1LgMfCz8ZvZccuhvkr%2FScreenshot%202024-09-15%20at%207.34.09%E2%80%AFPM.png?alt=media&amp;token=ed94d9f1-1a30-43c6-a6f0-570e29663de2" alt=""><figcaption></figcaption></figure>

## Initial Time Scales

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.

## In Game TimeScales

At runtime, information about each `LocalTimeScale` will be shown here, including the current value and the number of subscribers.

<figure><img src="https://2431624982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MY3N_li2jPq7az6mYfq%2Fuploads%2Ffm12fvY6s1JFjp233As4%2FScreenshot%202024-09-15%20at%207.10.54%E2%80%AFPM.png?alt=media&amp;token=8cedd12b-5f8e-4de9-9414-2585112d26a0" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Other objects which inherit from [`MagicTimeUser`](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md) or implement [`IUseMagicTime`](/magic-pig-games/magic-time-local-time-scale/magic-time-user/ihavelocaltime.md) can "Subscribe to Initial TimeScales". When this happens, they subscribe to the instance assigned to the **Magic Time Manager**.

This way, all objects will be following the same instance, and share the same information.
{% endhint %}

## All Time Scales

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.&#x20;

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.

## Additional Scripting

Don't forget to check out the [**Magic Time Manager Scripting**](/magic-pig-games/magic-time-local-time-scale/magic-time-manager/magic-time-manager-scripting.md) page for more information on what you can do with this class.

{% content-ref url="/pages/h47ese9W6c7usRvA83Sm" %}
[Magic Time Manager Scripting](/magic-pig-games/magic-time-local-time-scale/magic-time-manager/magic-time-manager-scripting.md)
{% endcontent-ref %}
