浏览代码

Initialize managers during `BeforeSceneLoad` both in editor and runtime (#30)

* Managers are now initialized during `BeforeSceneLoad` both in editor and runtime

* Updated Changelog

* Fix changelog
/main
GitHub 4 年前
当前提交
6b4482f3
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4
      CHANGELOG.md
  2. 6
      Runtime/Managers/Manager.cs

4
CHANGELOG.md


* Added generic `bool Manager.TryGet<T>(out T manager)`
#### Fixed
* **BEHAVIOR CHANGE/FIX** : Managers are now initialized during `BeforeSceneLoad` both in editor and runtime to prevent behavior discrepancies and rare `Resource.Load<>()` issues.
## 2020.2.1
#### Fixed

6
Runtime/Managers/Manager.cs


static readonly Type[] kAllManagerTypes = GetAllManagerTypes();
#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
#else
[RuntimeInitializeOnLoadMethod]
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void AutoCreateAll()
{
s_Managers.Clear();

正在加载...
取消
保存