| | |
| | | using LitJsonForAot;
|
| | | using System.Collections;
|
| | | using UnityEngine.Networking;
|
| | | using StartAotSDK;
|
| | | using UnityEngine.U2D;
|
| | |
|
| | |
|
| | | namespace StartAot
|
| | |
| | | public bool isPCTestDownLoad = false;
|
| | |
|
| | | public static readonly string[] VERSION_URL = new string[] {
|
| | | "http://gamecenter.secondworld.net.cn:11000/center/appversion_new.php/?"};
|
| | | "http://vncenter.daojmengxvn.com:11000/center/appversion_new.php/?"};
|
| | |
|
| | | readonly static List<string> excludePngs = new List<string>() { "Launch_1.png", "Launch_2.png", "Launch_3.png", "LoginBackGround.png", "TB_DL_Logo.png" };
|
| | |
|
| | | public int debugBranch { get; private set; }
|
| | |
|
| | |
| | | {
|
| | | if (Application.isMobilePlatform)
|
| | | {
|
| | | if (LocalSave.GetString("#@#BrancH") != string.Empty)
|
| | | {
|
| | | int tmpbranch;
|
| | | int.TryParse(LocalSave.GetString("#@#BrancH").Substring(1), out tmpbranch);
|
| | | if (tmpbranch != 0)
|
| | | debugBranch = tmpbranch;
|
| | | }
|
| | |
|
| | | var parentDirectory = Directory.GetParent(Application.persistentDataPath);
|
| | | if (File.Exists(parentDirectory + "/Debug"))
|
| | | {
|
| | |
| | | {
|
| | | spriteBundle?.Unload(true); //true完全卸载,更新后重新加载
|
| | | prefabBundle?.Unload(true);
|
| | | assetVersions.Clear();
|
| | | localAssetVersions.Clear();
|
| | | assetVersions = null;
|
| | | localAssetVersions = null;
|
| | | Debug.Log("提前ResourcesModel.Destroy资源");
|
| | | }
|
| | |
|
| | |
| | | public void RequestVersionCheck()
|
| | | {
|
| | | var versionConfig = VersionConfigEx.Get();
|
| | |
|
| | | if (versionConfig.assetAccess == VersionConfigEx.InstalledAsset.IngoreDownLoad)
|
| | | {
|
| | | step = LoadDllStep.ReadBytes;
|
| | | return;
|
| | | }
|
| | | var tables = new Dictionary<string, string>();
|
| | | tables["channel"] = versionConfig.appId;
|
| | | tables["versioncode"] = versionConfig.version;
|
| | |
| | |
|
| | | tables["game"] = versionConfig.gameId;
|
| | |
|
| | | var url = string.Concat(VERSION_URL[urlIndex % 2], HttpRequest.HashtablaToString(tables));
|
| | | //var url = string.Concat(VERSION_URL[urlIndex % 2], HttpRequest.HashtablaToString(tables));
|
| | | var url = string.Concat(VERSION_URL[0], HttpRequest.HashtablaToString(tables));
|
| | | urlIndex++;
|
| | | versionUrl = url;
|
| | | Debug.Log("http地址:versionUrl " + url);
|
| | |
| | | {
|
| | | versionUrlResult = _result.Replace("{}", "null");
|
| | | versionInfo = JsonMapper.ToObject<VersionInfo>(versionUrlResult);
|
| | |
|
| | | if (VersionConfigEx.Get().assetAccess == VersionConfigEx.InstalledAsset.IngoreDownLoad)
|
| | | {
|
| | | assetVersions = localAssetVersions;
|
| | | step = LoadDllStep.ReadBytes;
|
| | | return;
|
| | | }
|
| | | step = LoadDllStep.PrepareDownLoad;
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | Sprite sprite = null;
|
| | | #if UNITY_EDITOR
|
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Sprites/", name, ".png");
|
| | | sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(path);
|
| | | if (excludePngs.Contains(StringUtility.Contact(name, ".png")))
|
| | | {
|
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Sprites/", name, ".png");
|
| | | sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(path);
|
| | | }
|
| | | else
|
| | | {
|
| | | var spriteAtlas = UnityEditor.AssetDatabase.LoadAssetAtPath<SpriteAtlas>("Assets/ResourcesOut/BuiltIn/Sprites/sprites.spriteatlasv2");
|
| | | sprite = spriteAtlas.GetSprite(name);
|
| | | }
|
| | |
|
| | | #else
|
| | | if (spriteBundle == null)
|
| | |
| | | if (isOK)
|
| | | InitLocalLogicbytes(value);
|
| | | else
|
| | | Debug.LogError("InitTable logicbytes error");
|
| | | Debug.LogWarning("InitTable logicbytes error");
|
| | | }, StreamingAssetPath));
|
| | | }
|
| | | }
|
| | |
| | | try
|
| | | {
|
| | | var assetVersion = new AssetVersion(line);
|
| | | assetVersion.localValid = true;
|
| | | localAssetVersions[assetVersion.relativePath] = assetVersion;
|
| | | }
|
| | | catch (System.Exception ex)
|