123 1 год назад
Родитель
Сommit
bcb3f992e2

Разница между файлами не показана из-за своего большого размера
+ 174 - 142
Assets/Content/Prefabs/UI/UILanuch/UILanuch.prefab


BIN
Assets/Content/Raw_Art/UI/UILanuch/LOGO1.png


+ 9 - 9
Assets/Content/Raw_Art/UI/UILanuch/LOGO1.png.meta

@@ -6,7 +6,7 @@ TextureImporter:
   serializedVersion: 12
   mipmaps:
     mipMapMode: 0
-    enableMipMap: 1
+    enableMipMap: 0
     sRGBTexture: 1
     linearTexture: 0
     fadeOut: 0
@@ -36,13 +36,13 @@ TextureImporter:
     filterMode: 1
     aniso: 1
     mipBias: 0
-    wrapU: 0
-    wrapV: 0
+    wrapU: 1
+    wrapV: 1
     wrapW: 0
-  nPOTScale: 1
+  nPOTScale: 0
   lightmap: 0
   compressionQuality: 50
-  spriteMode: 0
+  spriteMode: 1
   spriteExtrude: 1
   spriteMeshType: 1
   alignment: 0
@@ -53,7 +53,7 @@ TextureImporter:
   alphaUsage: 1
   alphaIsTransparency: 1
   spriteTessellationDetail: -1
-  textureType: 0
+  textureType: 8
   textureShape: 1
   singleChannelComponent: 0
   flipbookRows: 1
@@ -76,7 +76,7 @@ TextureImporter:
     allowsAlphaSplitting: 0
     overridden: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   - serializedVersion: 3
     buildTarget: iPhone
     maxTextureSize: 2048
@@ -124,14 +124,14 @@ TextureImporter:
     allowsAlphaSplitting: 0
     overridden: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   spriteSheet:
     serializedVersion: 2
     sprites: []
     outline: []
     physicsShape: []
     bones: []
-    spriteID: 
+    spriteID: 5e97eb03825dee720800000000000000
     internalID: 0
     vertices: []
     indices: 

+ 107 - 0
Assets/Editor/AssetBundle/CheckHotUpdateRes.cs

@@ -177,7 +177,20 @@ public class CheckHotUpdateRes : EditorWindow
         {
             CopyTexture();
         }
+        if (GUILayout.Button("复制mainfest资源到输出路径"))
+        {
+            CopyMainfestFile();
+        }
+
+        if (GUILayout.Button("删除mainfest没有的资源"))
+        {
+            DelateNoFile();
+        }
 
+        if (GUILayout.Button("Tolua"))
+        {
+            AddLuaWrapBenginClassType("");
+        }
         GUILayout.Box("", GUILayout.Width(790));
         GUILayout.BeginHorizontal();
         GUILayout.Space(60);
@@ -297,7 +310,56 @@ public class CheckHotUpdateRes : EditorWindow
 
     }
 
+    private void CopyMainfestFile()
+    {
+        newPath = $"{info.NewPath}/{ info.mainfestFileName}";
+        List<VersionInfoData> newlist = GetInfoDatas(newPath);
+        if (newlist == null)
+        {
+            return;
+        }
+        int size = newlist.Count;
 
+        string datapath = $"{info.NewPath}/";
+
+        for (int i = 0; i < size; i++)
+        {
+            if (newlist[i].FullName == "Version")
+            {
+                continue;
+            }
+            byte[] fdatas = File.ReadAllBytes(datapath + newlist[i].FullName);
+
+            FileHelper.WirteToFile($"{info.OutputPath}/{newlist[i].FullName}", fdatas);
+
+        }
+    }
+
+
+    private void DelateNoFile()
+    {
+        newPath = $"{info.NewPath}/{ info.mainfestFileName}";
+        string[] files1 = FileHelper.GetAllFileNmae(info.NewPath, "meta");
+        List<VersionInfoData> newlist = GetInfoDatas(newPath);
+        int size = files1.Length;
+
+        string datapath = $"{info.NewPath}/";
+        for (int i = 0; i < size; i++)
+        {
+
+            if (files1[i] == "afivs" || files1[i] == "afimft")
+            {
+                continue;
+            }
+
+            if (newlist.FindFirst(it => it.FullName == files1[i]) == null)
+            {
+                FileHelper.DeleteFile(datapath + files1[i]);
+            }
+
+        }
+        
+    }
     private List<VersionInfoData> GetInfoDatas(string path)
     {
         List<VersionInfoData> list = null;
@@ -389,4 +451,49 @@ public class CheckHotUpdateRes : EditorWindow
         string datapath = $"{Application.dataPath}/Content/Icons/";
         FileHelper.CopyDir(datapath, info.OutputPath, "meta");
     }
+
+    //L.BeginClass(typeof(SingletonMono<LuaMgr>), typeof(MonoBase), \"SingletonMono_LuaMgr\");
+    private void AddLuaWrapBenginClassType(string path)
+    {
+        if (String.IsNullOrEmpty(path)) return;
+        string[] fdatas = File.ReadAllLines(path); //new string[] { "L.BeginClass(typeof(SingletonMono<LuaMgr>), typeof(MonoBase), \"SingletonMono_LuaMgr\");" };//
+        int length = fdatas.Length;
+        string newstr = "";
+        for (int i = 0; i < length; i++)
+        {
+            if (fdatas[i].Contains("BeginClass"))
+            {
+                string[] strarr = fdatas[i].Split("typeof(",StringSplitOptions.RemoveEmptyEntries);
+
+                string classname = strarr[1].Substring(0, strarr[1].IndexOf(")"));
+
+                if (classname.Contains("<"))
+                {
+                    string[] names = classname.Split(new char[]{ '<','>'},StringSplitOptions.RemoveEmptyEntries);
+
+
+                    classname = $"{names[0]}_{names[1]}";
+                }
+                Debug.Log($"Class Name = {classname}");
+                string nameStr = $"\"{classname}\"";
+
+                if (!fdatas[i].Contains(nameStr))
+                {
+                    int endid = fdatas[i].LastIndexOf(")");
+                    newstr = fdatas[i].Substring(0, endid);
+                    newstr += $", {nameStr});";
+                    fdatas[i] = newstr;
+                    Debug.Log($"New String = {newstr}");
+                }
+             
+               break;
+            }
+        }
+        if (newstr != "")
+        {
+            //Debug.Log("写");
+            File.WriteAllLines(path,fdatas);
+        }
+        
+    }
 }

+ 3 - 1
Assets/Lua/Core/LuaMain.lua

@@ -70,7 +70,9 @@ local percent = 0
 InternalRequire = function(name, endStep)
     if percent then
         percent = percent + 1
-        LuaMgr:StartMainPrecent(percent / 180)
+        LuaMgr:StartMainPrecent(percent / 190)
+        -- local temp =(percent / 190 * 80) + 10 
+        -- LogError("pr = "..temp.."  Name = " ..name)
     end
     local data = require(name)
     if data and type(data) == 'function' then

Разница между файлами не показана из-за своего большого размера
+ 549 - 358
Assets/OPS/Obfuscator/Log/iOS.txt


+ 8 - 0
Assets/OPS/Obfuscator/Settings/Obfuscator_Settings.json

@@ -114,6 +114,14 @@
           "Key" : "Obfuscate_Namespaces",
           "Value" : "True",
           "Values" : null
+        },
+        {
+          "Type" : "Array_String",
+          "Key" : "Skip_Namespace_Array",
+          "Value" : null,
+          "Values" : [
+            "LuaInterface"
+          ]
         }
       ]
     },

+ 13 - 4
Assets/Src/Core/DownLoad/CsvWriter.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 
 using System.Collections.Generic;
 
@@ -12,11 +12,12 @@ namespace Game.Config
         private StringBuilder data;
         private string name;
         private string path;
-
+        private bool isReflection;//是否反射
 
         public string Data { get => data.ToString(); }
-        public CsvWriter(string wpath,string fname,List<T> datas, GameDataFormatInfo dataFormatInfo = null)
+        public CsvWriter(string wpath,string fname,List<T> datas, GameDataFormatInfo dataFormatInfo = null,bool isreflection = true)
         {
+            isReflection = isreflection;
             data = new StringBuilder();
             name = fname;
             path = wpath;
@@ -36,7 +37,15 @@ namespace Game.Config
             data.Append(ToCsvLine(info.Types));
             foreach (GameData gd in datas)
             {
-                string[] linedatas = ExcelParser.Deserialize(type, gd,info.Fileds); 
+
+                string[] linedatas = null; if (isReflection)
+                { 
+                    linedatas = ExcelParser.Deserialize(type, gd, info.Fileds); 
+                }
+                else
+                {
+                    linedatas = ExcelParser.Deserialize_NoReflection(gd, info.Fileds);
+                }
                 string line = ToCsvLine(linedatas);
                 data.Append(line);
             }

+ 61 - 1
Assets/Src/Core/DownLoad/DownloadDataEntity.cs

@@ -24,6 +24,66 @@ public class DownloadDataEntity : GameData<DownloadDataEntity>
         return "mainfest";
     }
 
+    public override bool SetFields(string fieldname, string value)
+    {
+        bool ret = base.SetFields(fieldname, value);
+        if (!ret)
+        {
+            switch (fieldname)
+            {
+                case "FullName":
+                    {
+                        FullName = value;
+                        ret = true;
+                    }
+                    ; break;
+                case "MD5":
+                    {
+                        MD5 = value;
+                        ret = true;
+                    }
+                    ; break;
+                case "Size":
+                    {
+                        Size = ulong.Parse(value);
+                        ret = true;
+                    }
+                    ; break;
+            }
+        }
+        return ret;
+    }
+
+
+    public override string GetFieldValue(string fieldname)
+    {
+        string ret = "";
+        switch (fieldname)
+        {
+            case "ID":
+                {
+                    ret = ID.ToString();
+                }
+                    ; break;
+            case "FullName":
+                {
+                    ret = FullName;
+                }
+                    ; break;
+            case "MD5":
+                {
+                    ret = MD5;
+                }
+                    ; break;
+            case "Size":
+                {
+                    ret = Size.ToString();
+                }
+                    ; break;
+        }
+        return ret;
+
+    }
     public DownloadDataEntity()
     {
         FullName = "";
@@ -34,6 +94,6 @@ public class DownloadDataEntity : GameData<DownloadDataEntity>
     }
     public static void OnCsvLoad(CsvReader csvReader)
     {
-        DownloadDataEntity.Onload(csvReader);
+        DownloadDataEntity.Onload_SetField(csvReader);
     }
 }

+ 2 - 2
Assets/Src/Core/DownLoad/DownloadMgr.cs

@@ -293,7 +293,7 @@ public class DownloadMgr : Singleton<DownloadMgr>
         
         string savepath = localFilePath + downloadedAssetsFileName;
 
-        CsvWriter<DownloadDataEntity> csvWriter = new CsvWriter<DownloadDataEntity>(savepath, "", downloadSucessList, downloadFormatInfo);
+        CsvWriter<DownloadDataEntity> csvWriter = new CsvWriter<DownloadDataEntity>(savepath, "", downloadSucessList, downloadFormatInfo,false);
         csvWriter.Write();
   
     }
@@ -725,7 +725,7 @@ public class DownloadMgr : Singleton<DownloadMgr>
             if (remoteResList.Count > 0)
             {
                 //Debug.Log($" ============= remoteResList.Count = {remoteResList.Count}" );
-                CsvWriter<DownloadDataEntity> csvWriter = new CsvWriter<DownloadDataEntity>(LocalFilePath + assetsFileName, "", remoteResList, downloadFormatInfo);
+                CsvWriter<DownloadDataEntity> csvWriter = new CsvWriter<DownloadDataEntity>(LocalFilePath + assetsFileName, "", remoteResList, downloadFormatInfo,false);
                 csvWriter.Write();
             }          
         }        

+ 24 - 0
Assets/Src/Core/DownLoad/ExcelParser.cs

@@ -30,7 +30,19 @@ namespace Game.Config
 
             return obj;
         }
+        public static T Serializable_NotReflection<T>(string[] fields, string[] data) where T : GameData
+        {
+            Type type = typeof(T);
+            T obj = Activator.CreateInstance<T>();
+
+            int length = fields.Length;
+            for (int i = 0; i < length; i++)
+            {            
+                obj.SetFields(fields[i],data[i]);
+            }
 
+            return obj;
+        }
         public static GameData Serializable(Type type, string[] fields, string[] data)
         {
             GameData obj = (GameData)Activator.CreateInstance(type);
@@ -46,6 +58,18 @@ namespace Game.Config
             return obj;
         }
 
+        public static string[] Deserialize_NoReflection(GameData data, string[] fields)
+        {
+            int length = fields.Length;
+            string[] ret = new string[length];
+
+            for (int i = 0; i < length; i++)
+            {
+                ret[i] = data.GetFieldValue(fields[i]);
+            }
+
+            return ret;
+        }
         public static string[] Deserialize(Type type, GameData data, string[] fields)
         {
             int length = fields.Length;

+ 41 - 6
Assets/Src/Core/DownLoad/GameDatabase.cs

@@ -8,14 +8,36 @@ using System.Reflection;
 using UnityEngine;
 
 
-    public abstract class GameData
+public abstract class GameData
+{
+    public int ID;
+    public abstract string FlieName();
+    public virtual bool SetFields(string fieldname, string value)
     {
-        public int ID;
-        public abstract string FlieName();
+        bool ret = false;
+
+        if (fieldname == "ID")
+        {
+            ret = true;
+            ID = int.Parse(value);
+        }
+
+        return ret;
+    }
+
+    public virtual string GetFieldValue(string fieldname)
+    {
+        string ret = "";
+        if (fieldname == "ID")
+        {
+            ret = ID.ToString();          
+        }
+        return ret;
     }
+}
 
 
-    public abstract class GameData<T> : GameData where T : GameData
+public abstract class GameData<T> : GameData where T : GameData
     {
         
         protected static Dictionary<int, T> configDatas = new Dictionary<int, T>();
@@ -41,8 +63,21 @@ using UnityEngine;
                 configDatas.Add(data.ID, data);
             }
         }
-
-        public static T GetData(int id)
+    protected static void Onload_SetField(CsvReader csvReader)
+    {
+        configDatas.Clear();
+        string[][] datas = csvReader.RowDatas;
+        fields = csvReader.Fields();
+        types = csvReader.Types();
+        int length = datas.Length;
+        for (int i = 2; i < length; i++)
+        {
+            T data = ExcelParser.Serializable_NotReflection<T>(fields, datas[i]);
+            //Debug.Log(data.FlieName() + data.ID);
+            configDatas.Add(data.ID, data);
+        }
+    }
+    public static T GetData(int id)
         {
             T data = null;
             if (configDatas.ContainsKey(id))

+ 1 - 0
Assets/Src/GameLogic/LaunchLoadMgr.cs

@@ -236,6 +236,7 @@ public class LaunchLoadMgr
 
         if (result)
         {
+            Debug.Log($"==================precent=={precent}=====================================");
             EventMgr.RemoveEventListener<bool, float>(ECoreEventType.EID_LOAD_LUA_OK, OnLoadLuaOk);
             SetLoadDes("GameLogin17");
             NetworkMgr.CreateInstance();

+ 1 - 1
Assets/Src/ToLuaExtend/CS2LuaObject/CGLogic.cs

@@ -1,7 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
-
+using LuaInterface;
 public class CGLogic : MonoBehaviour 
 {
     public Transform m_cgRoot;

+ 4 - 1
Assets/ToLua/Misc/LuaClient.cs

@@ -1,4 +1,4 @@
-/*
+/*
 Copyright (c) 2015-2017 topameng(topameng@qq.com)
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,6 +29,8 @@ using System;
 using UnityEngine.SceneManagement;
 #endif
 
+ namespace LuaInterface
+{
 public class LuaClient : MonoBehaviour
 {
     public static LuaClient Instance
@@ -290,3 +292,4 @@ public class LuaClient : MonoBehaviour
         }
     }
 }
+}

+ 95 - 93
Assets/ToLua/Misc/LuaResLoader.cs

@@ -1,4 +1,4 @@
-/*
+/*
 Copyright (c) 2015-2017 topameng(topameng@qq.com)
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,17 +25,18 @@ using UnityEngine;
 using LuaInterface;
 using System.IO;
 using System.Text;
-
-public class LuaResLoader : LuaFileUtils
+namespace LuaInterface
 {
-    public LuaResLoader()
+    public class LuaResLoader : LuaFileUtils
     {
-        instance = this;
-        beZip = false;
-    }
+        public LuaResLoader()
+        {
+            instance = this;
+            beZip = false;
+        }
 
-    public override byte[] ReadFile(string fileName)
-    {  
+        public override byte[] ReadFile(string fileName)
+        {
 #if !UNITY_EDITOR
         byte[] buffer = ReadDownLoadFile(fileName);
 
@@ -49,107 +50,108 @@ public class LuaResLoader : LuaFileUtils
             buffer = base.ReadFile(fileName);
         }        
 #else
-        byte[] buffer = base.ReadFile(fileName);
+            byte[] buffer = base.ReadFile(fileName);
 
-        if (buffer == null)
-        {
-            buffer = ReadResourceFile(fileName);
-        }
+            if (buffer == null)
+            {
+                buffer = ReadResourceFile(fileName);
+            }
 
-        if (buffer == null)
-        {
-            buffer = ReadDownLoadFile(fileName);
-        }
+            if (buffer == null)
+            {
+                buffer = ReadDownLoadFile(fileName);
+            }
 #endif
 
-        return buffer;
-    }
-
-    public override string FindFileError(string fileName)
-    {
-        if (Path.IsPathRooted(fileName))
-        {
-            return fileName;
+            return buffer;
         }
 
-        if (Path.GetExtension(fileName) == ".lua")
+        public override string FindFileError(string fileName)
         {
-            fileName = fileName.Substring(0, fileName.Length - 4);            
-        }
-
-        using (CString.Block())
-        {
-            CString sb = CString.Alloc(512);
+            if (Path.IsPathRooted(fileName))
+            {
+                return fileName;
+            }
 
-            for (int i = 0; i < searchPaths.Count; i++)
+            if (Path.GetExtension(fileName) == ".lua")
             {
-                sb.Append("\n\tno file '").Append(searchPaths[i]).Append('\'');
+                fileName = fileName.Substring(0, fileName.Length - 4);
             }
 
-            sb.Append("\n\tno file './Resources/").Append(fileName).Append(".lua'")
-              .Append("\n\tno file '").Append(LuaConst.luaResDir).Append('/')
-			  .Append(fileName).Append(".lua'");
-            sb = sb.Replace("?", fileName);
+            using (CString.Block())
+            {
+                CString sb = CString.Alloc(512);
+
+                for (int i = 0; i < searchPaths.Count; i++)
+                {
+                    sb.Append("\n\tno file '").Append(searchPaths[i]).Append('\'');
+                }
+
+                sb.Append("\n\tno file './Resources/").Append(fileName).Append(".lua'")
+                  .Append("\n\tno file '").Append(LuaConst.luaResDir).Append('/')
+                  .Append(fileName).Append(".lua'");
+                sb = sb.Replace("?", fileName);
 
-            return sb.ToString();
+                return sb.ToString();
+            }
         }
-    }
 
-    byte[] ReadResourceFile(string fileName)
-    {
-        if (!fileName.EndsWith(".lua"))
+        byte[] ReadResourceFile(string fileName)
         {
-            fileName += ".lua";
-        }
+            if (!fileName.EndsWith(".lua"))
+            {
+                fileName += ".lua";
+            }
 
-        byte[] buffer = null;
-        string path = "Lua/" + fileName;
-        TextAsset text = Resources.Load(path, typeof(TextAsset)) as TextAsset;
+            byte[] buffer = null;
+            string path = "Lua/" + fileName;
+            TextAsset text = Resources.Load(path, typeof(TextAsset)) as TextAsset;
 
-        if (text != null)
-        {
-            buffer = text.bytes;
-            Resources.UnloadAsset(text);
-        }
+            if (text != null)
+            {
+                buffer = text.bytes;
+                Resources.UnloadAsset(text);
+            }
 
-        return buffer;
-    }
+            return buffer;
+        }
 
-    byte[] ReadDownLoadFile(string fileName)
-    {
-        byte[] bytes = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
-        //string content = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
-        //if (null != content)
-        //{
-        //    bytes = Encoding.Default.GetBytes(content);
-        //}
-        //TextAsset ta = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
-        //if (null != ta)
-        //{
-        //    bytes = ta.bytes;
-        //}
-        return bytes;
-        //        if (!fileName.EndsWith(".lua"))
-        //        {
-        //            fileName += ".lua";
-        //        }
-
-        //        string path = fileName;
-
-        //        if (!Path.IsPathRooted(fileName))
-        //        {            
-        //            path = string.Format("{0}/{1}", LuaConst.luaResDir, fileName);            
-        //        }
-
-        //        if (File.Exists(path))
-        //        {
-        //#if !UNITY_WEBPLAYER
-        //            return File.ReadAllBytes(path);
-        //#else
-        //            throw new LuaException("can't run in web platform, please switch to other platform");
-        //#endif
-        //        }
-
-        //        return null;
+        byte[] ReadDownLoadFile(string fileName)
+        {
+            byte[] bytes = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
+            //string content = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
+            //if (null != content)
+            //{
+            //    bytes = Encoding.Default.GetBytes(content);
+            //}
+            //TextAsset ta = LuaMgr.Instance.GetLuaTextAsset(GetAddLuaSuffix(fileName));
+            //if (null != ta)
+            //{
+            //    bytes = ta.bytes;
+            //}
+            return bytes;
+            //        if (!fileName.EndsWith(".lua"))
+            //        {
+            //            fileName += ".lua";
+            //        }
+
+            //        string path = fileName;
+
+            //        if (!Path.IsPathRooted(fileName))
+            //        {            
+            //            path = string.Format("{0}/{1}", LuaConst.luaResDir, fileName);            
+            //        }
+
+            //        if (File.Exists(path))
+            //        {
+            //#if !UNITY_WEBPLAYER
+            //            return File.ReadAllBytes(path);
+            //#else
+            //            throw new LuaException("can't run in web platform, please switch to other platform");
+            //#endif
+            //        }
+
+            //        return null;
+        }
     }
-}
+}

+ 3 - 1
Assets/ToLua/Source/Generate/DelegateFactory.cs

@@ -1,7 +1,8 @@
 //this source code was auto-generated by tolua#, do not modify it
 using System;
 using System.Collections.Generic;
-using LuaInterface;
+namespace LuaInterface 
+{ 
 
 public class DelegateFactory
 {
@@ -7159,3 +7160,4 @@ public class DelegateFactory
 
 }
 
+}

+ 2 - 2
Assets/ToLua/Source/Generate/LuaMgrWrap.cs

@@ -1,4 +1,4 @@
-//this source code was auto-generated by tolua#, do not modify it
+//this source code was auto-generated by tolua#, do not modify it
 using System;
 using LuaInterface;
 
@@ -6,7 +6,7 @@ public class LuaMgrWrap
 {
 	public static void Register(LuaState L)
 	{
-		L.BeginClass(typeof(LuaMgr), typeof(SingletonMono<LuaMgr>));
+		L.BeginClass(typeof(LuaMgr), typeof(SingletonMono<LuaMgr>), "LuaMgr");
 		L.RegFunction("InitMgr", InitMgr);
 		L.RegFunction("Clear", Clear);
 		L.RegFunction("CallMain", CallMain);

Некоторые файлы не были показаны из-за большого количества измененных файлов