| | |
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.FullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | if (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | progressBuf = progress;
|
| | |
|
| | | var allFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, allFiles);
|
| | |
|
| | | var count = allFiles.Count;
|
| | | var index = 0;
|
| | | while (index < count)
|
| | | {
|
| | | try
|
| | | {
|
| | | var fileInfo = allFiles[index];
|
| | | var destPath = fileInfo.FullName.Replace(ResourcesPath.Instance.StreamingAssetPath, ResourcesPath.Instance.ExternalStorePath);
|
| | | if (File.Exists(destPath))
|
| | | {
|
| | | index++;
|
| | | continue;
|
| | | }
|
| | |
|
| | | var destDirectoryName = Path.GetDirectoryName(destPath);
|
| | | if (!Directory.Exists(destDirectoryName))
|
| | | {
|
| | | Directory.CreateDirectory(destDirectoryName);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("拷贝文件:{0}", fileInfo.Name);
|
| | | File.Copy(fileInfo.FullName, destPath, true);
|
| | | index++;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | }
|
| | |
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | LocalSave.SetString("AssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | }
|
| | | break;
|
| | | case InstalledAsset.NullAsset:
|
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | #endif
|
| | |
|
| | | OperationLogCollect.Instance.RecordLauchEvent(2);
|
| | | OperationLogCollect.Instance.RecordEvent(2);
|
| | |
|
| | | m_CurrentStage = LaunchStage.ClientVersion;
|
| | | if (!Application.isEditor || InGameDownTestUtility.enable)
|
| | |
| | | yield return null;
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | |
|
| | | m_CurrentStage = LaunchStage.ClientVersion;
|
| | | if (!Application.isEditor || InGameDownTestUtility.enable)
|
| | | {
|
| | | VersionUtility.Instance.RequestVersionCheck();
|
| | | progressBuf = progress;
|
| | | timer = 0f;
|
| | | duration = 1f;
|
| | |
|
| | | while (!VersionUtility.Instance.completed)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.1f, progressBuf, progressBuf + 0.1f);
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | |
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 1)
|
| | | {
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.FullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | if (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | progressBuf = progress;
|
| | |
|
| | | var allFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, allFiles);
|
| | |
|
| | | var count = allFiles.Count;
|
| | | var index = 0;
|
| | | while (index < count)
|
| | | {
|
| | | try
|
| | | {
|
| | | var fileInfo = allFiles[index];
|
| | | var destPath = fileInfo.FullName.Replace(ResourcesPath.Instance.StreamingAssetPath, ResourcesPath.Instance.ExternalStorePath);
|
| | | if (File.Exists(destPath))
|
| | | {
|
| | | index++;
|
| | | continue;
|
| | | }
|
| | |
|
| | | var destDirectoryName = Path.GetDirectoryName(destPath);
|
| | | if (!Directory.Exists(destDirectoryName))
|
| | | {
|
| | | Directory.CreateDirectory(destDirectoryName);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("拷贝文件:{0}", fileInfo.Name);
|
| | | File.Copy(fileInfo.FullName, destPath, true);
|
| | | index++;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | }
|
| | |
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | LocalSave.SetString("AssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | }
|
| | | break;
|
| | | case InstalledAsset.NullAsset:
|
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | #endif
|
| | |
|
| | | OperationLogCollect.Instance.RecordLauchEvent(2);
|
| | | OperationLogCollect.Instance.RecordEvent(2);
|
| | |
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 1)
|
| | | {
|