From 23e7b2827ec8ad8a7e3faa3d3c9e0785f471f3c9 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 29 七月 2024 18:10:04 +0800
Subject: [PATCH] 0312 debug文件优先级>设置分支

---
 Assets/Launch/ResourcesModel.cs |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/Assets/Launch/ResourcesModel.cs b/Assets/Launch/ResourcesModel.cs
index 67d0978..4d05491 100644
--- a/Assets/Launch/ResourcesModel.cs
+++ b/Assets/Launch/ResourcesModel.cs
@@ -5,6 +5,8 @@
 using LitJsonForAot;
 using System.Collections;
 using UnityEngine.Networking;
+using StartAotSDK;
+using UnityEngine.U2D;
 
 
 namespace StartAot
@@ -25,8 +27,9 @@
         public bool isPCTestDownLoad = false;
 
         public static readonly string[] VERSION_URL = new string[] {
-        "http://vncenter.tuyetvn.com: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; }
 
@@ -105,6 +108,14 @@
         {
             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"))
                 {
@@ -246,8 +257,16 @@
         {
             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)

--
Gitblit v1.8.0