Skip to content

CoreSystem and ApplicationSystem

Feynmen edited this page Jun 18, 2018 · 4 revisions

CoreSystem

This script finds all class which implement the interface IManager, сreates an instance, and add it to the dictionary. This logic starts in the static constructor. In the editor, when you start a project, on the game object with this script you can see all connected managers.

You have two functions for access to managers:

 public T GetManager<T>() where T : IManager
 public object GetManager(Type type)

When Unity invoke OnApplicationQuit, in all managers will execute function Release

ApplicationSystem

This script inherited from CoreSystem. The main goal of this script is to init CoreSystem in Awake Unity function and be DontDestroyOnLoad. Also at Start Unity function:

Screen.sleepTimeout = SleepTimeout.NeverSleep;

You can start Coroutine using this script by:

public static Coroutine StartMainCoroutine(IEnumerator enumerator)

Clone this wiki locally