| | |
| | | return model;
|
| | | }
|
| | |
|
| | | // 此处加try的原因是 遇不报错的情况
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var beforePlayerDataInitialize = model as IBeforePlayerDataInitialize;
|
| | |
| | | beforePlayerDataInitialize.OnBeforePlayerDataInitialize();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnAfterPlayerDataInitialize()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var afterPlayerDataInitialize = model as IAfterPlayerDataInitialize;
|
| | |
| | | afterPlayerDataInitialize.OnAfterPlayerDataInitialize();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | { |
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var playerLoginOk = model as IPlayerLoginOk;
|
| | | if (playerLoginOk != null)
|
| | | {
|
| | | playerLoginOk.OnPlayerLoginOk();
|
| | | }
|
| | | if (playerLoginOk != null)
|
| | | {
|
| | | playerLoginOk.OnPlayerLoginOk();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnMapInitOk()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var mapInitOk = model as IMapInitOk;
|
| | |
| | | mapInitOk.OnMapInitOk();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnAccountSwitch()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var switchAccount = model as ISwitchAccount;
|
| | |
| | | switchAccount.OnSwitchAccount();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | }
|