gdl_123 2 ヶ月 前
コミット
0be5fa5a19

+ 2 - 2
Assets/Editor/CsvToLua/CsvToLua.cs

@@ -918,7 +918,7 @@ return aaa";
                         if (isCheck&& !path.Contains(metastr))
                         {
                             checkList.Add(path+"\r\n");
-                            if (copyqsFile)
+                            if (copyqsFile&& File.Exists(path))
                             {
                                 File.Copy(path, fileOutputPath, true);
                             }
@@ -1100,7 +1100,7 @@ return aaa";
                     string basepath = copycfg.RawGet<string, string>("basepath");
                     string path = copycfg.RawGet<string, string>("path");
                     string fileName = copycfg.RawGet<string, string>("fileName");
-                    if (fileName.Contains(".png"))
+                    if (fileName.Contains(".png")&& File.Exists(fileroot + fileName))
                     {
                         string opp = output + basepath + path + fileName;
                         File.Copy(fileroot + fileName, opp, true);

+ 19 - 0
Assets/Src/Core/Config/LocalizedTextureCfgMgr.cs

@@ -171,6 +171,25 @@ public class LocalizedTextureCfgMgr : Singleton<LocalizedTextureCfgMgr>
     }
 
 
+    public LocalizedSpriteCfg GetCfgByLgkey(string lgKey,string key,bool def = true)
+    {
+        if (!isOpen)
+        {
+            return null;
+        }
+        if (cfgs.ContainsKey(lgKey)&&cfgs[lgKey].ContainsKey(key))
+        {
+            return cfgs[lgKey][key];
+        }
+
+        if (def && cfgs[baseKey].ContainsKey(key))
+        {
+            return cfgs[baseKey][key];
+        }
+
+        return null;
+    }
+
     public string GetLocalize(string key, bool notbase = false)
     {
         if (!isOpen)

+ 9 - 2
Assets/Src/ExtendComponents/UILocalizeTexture.cs

@@ -6,7 +6,7 @@ using UnityEngine.UI;
 
 public class UILocalizeTexture : MonoBehaviour
 {
-
+    public string lgKey;
     public string key;
 
     private Image mImage;
@@ -53,7 +53,14 @@ public class UILocalizeTexture : MonoBehaviour
         if (string.IsNullOrEmpty(key) || mImage == null)
             return;
 
-        spriteCfg = LocalizedTextureCfgMgr.Instance.GetLocalizedSpriteCfg(key);
+        if (string.IsNullOrEmpty(lgKey))
+        {
+            spriteCfg = LocalizedTextureCfgMgr.Instance.GetLocalizedSpriteCfg(key);
+        }
+        else
+        {
+            spriteCfg = LocalizedTextureCfgMgr.Instance.GetCfgByLgkey(lgKey,key);
+        }
         if (spriteCfg == null || oldname == spriteCfg.Language)
         {
             return;