5038 【1.3】4G环境下,地图分包下载显示优化
| | |
| | | return completeCount / (float)total;
|
| | | }
|
| | |
|
| | | int mapId = 0;
|
| | | Action mapAssetDownLoadOk;
|
| | | public void RegisterMapAssetDownLoadOk(int mapId, Action callBack)
|
| | | {
|
| | | this.mapId = mapId;
|
| | | mapAssetDownLoadOk = callBack;
|
| | | }
|
| | |
|
| | | public void UnRegisterMapAssetDownLoadOk()
|
| | | {
|
| | | this.mapId = 0;
|
| | | mapAssetDownLoadOk = null;
|
| | | }
|
| | |
|
| | | public void TryDownLoad(Dominant _dominant)
|
| | | {
|
| | | if (!inGameDownLoadAllow)
|
| | |
| | | networkReachability = Application.internetReachability;
|
| | | }
|
| | | }
|
| | |
|
| | | if (mapId != 0)
|
| | | {
|
| | | var progress = GetMapAssetDownLoadProgress(mapId);
|
| | | if (progress > 0.9999f)
|
| | | {
|
| | | if (mapAssetDownLoadOk != null)
|
| | | {
|
| | | mapAssetDownLoadOk();
|
| | | mapAssetDownLoadOk = null;
|
| | | mapId = 0;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public bool CheckDominantDownLoad()
|
| | |
| | | {
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class MapModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IMapInitOk
|
| | | public class MapModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IMapInitOk
|
| | | {
|
| | | Dictionary<int, WorldMapArea> worldMapAreas = new Dictionary<int, WorldMapArea>();
|
| | | Dictionary<int, bool> worldMapUnLockStates = new Dictionary<int, bool>();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | InGameDownLoad.Instance.UnRegisterMapAssetDownLoadOk();
|
| | | var map = Config.Instance.Get<MapConfig>(_mapId);
|
| | | var position = new Vector3(map.BornPoints[0].x, 0, map.BornPoints[0].y);
|
| | | MapTransferUtility.Send_WorldTransfer(_mapId, position, MapTransferType.WorldTransport, (byte)_lineId, 0);
|
| | |
| | | if (mapAssetDownLoadProgress != null)
|
| | | {
|
| | | mapAssetDownLoadProgress.OnComplete(null);
|
| | | InGameDownLoad.Instance.RegisterMapAssetDownLoadOk(this.m_MapArea.id, () =>
|
| | | {
|
| | | var config = Config.Instance.Get<MapConfig>(this.m_MapArea.id);
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | "Mail101",
|
| | | Language.Get("LoadMap1", config.Name),
|
| | | () => { model.RequestMapTransport(this.m_MapArea.id); }
|
| | | );
|
| | | });
|
| | | }
|
| | |
|
| | | StopAllCoroutines();
|
| | | }
|
| | |
|
| | |
| | | behaviour.transform.SetParentEx(m_Conainter.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
| | | }
|
| | |
|
| | | InGameDownLoad.Instance.UnRegisterMapAssetDownLoadOk();
|
| | | mapAssetDownLoadProgress.mapId = m_MapArea.id;
|
| | | mapAssetDownLoadProgress.OnComplete(() =>
|
| | | {
|