| | |
| | | using UnityEngine; |
| | | using System.IO; |
| | | using System; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | #if UNITY_EDITOR |
| | | using UnityEditor; |
| | | #endif |
| | |
| | | [RuntimeInitializeOnLoadMethod] |
| | | public static void Init() |
| | | { |
| | | if (InGameDownTestUtility.enable) |
| | | { |
| | | VersionConfig.Get().assetAccess = InstalledAsset.NullAsset; |
| | | } |
| | | else |
| | | { |
| | | VersionConfig.Get().assetAccess = InstalledAsset.IngoreDownLoad; |
| | | } |
| | | VersionConfig.GetAsync().ContinueWith(config => { |
| | | if (InGameDownTestUtility.enable) |
| | | { |
| | | config.assetAccess = InstalledAsset.NullAsset; |
| | | } |
| | | else |
| | | { |
| | | config.assetAccess = InstalledAsset.IngoreDownLoad; |
| | | } |
| | | |
| | | VersionConfig.Get().partAssetPackage = InGameDownTestUtility.isPartPackage; |
| | | config.partAssetPackage = InGameDownTestUtility.isPartPackage; |
| | | }).Forget(); |
| | | |
| | | } |
| | | #endif |
| | | |
| | | public static bool GetReadVerionEx() |
| | | { |
| | | #if UNITY_EDITOR |
| | | //生成VersionConfigEx.txt 提供给AOT启动时使用 |
| | | var json = JsonUtility.ToJson(VersionConfig.Get()); |
| | | string versionConfigExFile = Application.dataPath + "/Resources/VersionConfigEx.txt"; |
| | | if (File.Exists(versionConfigExFile)) |
| | | VersionConfig.GetAsync().ContinueWith(config => |
| | | { |
| | | File.Delete(versionConfigExFile); |
| | | } |
| | | File.WriteAllText(versionConfigExFile, json); |
| | | AssetDatabase.SaveAssets(); |
| | | AssetDatabase.Refresh(); |
| | | Debug.Log("同步VersionConfigEx.txt成功"); |
| | | //生成VersionConfigEx.txt 提供给AOT启动时使用 |
| | | var json = JsonUtility.ToJson(config); |
| | | string versionConfigExFile = Application.dataPath + "/Resources/VersionConfigEx.txt"; |
| | | if (File.Exists(versionConfigExFile)) |
| | | { |
| | | File.Delete(versionConfigExFile); |
| | | } |
| | | File.WriteAllText(versionConfigExFile, json); |
| | | AssetDatabase.SaveAssets(); |
| | | AssetDatabase.Refresh(); |
| | | Debug.Log("同步VersionConfigEx.txt成功"); |
| | | }).Forget(); |
| | | |
| | | #endif |
| | | return enable && isReadVesionEx; |
| | | } |