> 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

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="/files/xOLu6qcPTnPDT0kuRXpr" 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="/files/m4H0QgLbVIBDfTVkyzu5" 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 %}
