|
|
|
|
|
|
[RuntimeInitializeOnLoadMethod] |
|
|
|
static void AutoCreateAll() |
|
|
|
{ |
|
|
|
Debug.Log("Initializing all Managers..."); |
|
|
|
foreach(var type in kAllManagerTypes) |
|
|
|
{ |
|
|
|
var attrib =type.GetCustomAttribute<ManagerDefaultPrefabAttribute>(); |
|
|
|
|
|
|
GameObject.DontDestroyOnLoad(gameObject); |
|
|
|
var comp = (Manager)gameObject.GetComponent(type); |
|
|
|
s_Managers.Add(type,comp); |
|
|
|
|
|
|
|
Debug.Log(string.Format(" -> <{0}> OK", type.Name)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|