Merge branch '0优化/热更看大小优化' into master_xma_local
# Conflicts: # Assets/ManagedResources/~Lua/Message/MessageTypeProto_pb.luadev_chengFeng
commit
1581d7d22a
|
|
@ -85,10 +85,10 @@ AnimatorStateMachine:
|
||||||
m_ChildStates:
|
m_ChildStates:
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: 1102617346665670686}
|
m_State: {fileID: 1102617346665670686}
|
||||||
m_Position: {x: 240, y: 60, z: 0}
|
m_Position: {x: 324, y: 264, z: 0}
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: 1102461298529390142}
|
m_State: {fileID: 1102461298529390142}
|
||||||
m_Position: {x: 252, y: -48, z: 0}
|
m_Position: {x: 420, y: -72, z: 0}
|
||||||
m_ChildStateMachines: []
|
m_ChildStateMachines: []
|
||||||
m_AnyStateTransitions: []
|
m_AnyStateTransitions: []
|
||||||
m_EntryTransitions: []
|
m_EntryTransitions: []
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -159,12 +159,12 @@ function this.OnClickTabBtn(_index, _clickBtn, isTop)
|
||||||
print("_index ".._index)
|
print("_index ".._index)
|
||||||
if _index == ItemBaseType.Equip then
|
if _index == ItemBaseType.Equip then
|
||||||
local allEquipData = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
|
local allEquipData = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
|
||||||
local allEquipNum = 0
|
-- local allEquipNum = 0
|
||||||
for i, v in pairs(allEquipData) do
|
for i, v in pairs(allEquipData) do
|
||||||
table.insert(itemData, v)
|
table.insert(itemData, v)
|
||||||
allEquipNum = allEquipNum + v.num
|
-- allEquipNum = allEquipNum + v.num
|
||||||
end
|
end
|
||||||
itemNumText.text = Language[10188]..allEquipNum.."/"..ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipNumlimit
|
itemNumText.text = Language[10188]..LengthOfTable(allEquipData).."/"..ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipNumlimit
|
||||||
this:SetItemData(itemData, isTop)
|
this:SetItemData(itemData, isTop)
|
||||||
-- elseif _index == 0 then
|
-- elseif _index == 0 then
|
||||||
-- this:OnClickAllBtn()
|
-- this:OnClickAllBtn()
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ function this:BindEvent()
|
||||||
end
|
end
|
||||||
end, 0.5)
|
end, 0.5)
|
||||||
end
|
end
|
||||||
Util.AddLongPressClick(this.compoundSoulPrintBtn, function()
|
Util.AddClick(this.compoundSoulPrintBtn, function()
|
||||||
UIManager.OpenPanel(UIName.SoulPrintPopUp,0,nil,curSelectSoulPrint.Id,nil,nil)
|
UIManager.OpenPanel(UIName.SoulPrintPopUp,0,nil,curSelectSoulPrint.Id,nil,nil)
|
||||||
end, 0.5)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ function this.SingleItemDataShow(_go,_curequipSign)
|
||||||
Util.GetGameObject(_go.transform,"circleFrameBg/Icon"):GetComponent("Image").sprite=Util.LoadSprite(GetResourcePath(itemConfig[curequipSign.Id].ResourceID))
|
Util.GetGameObject(_go.transform,"circleFrameBg/Icon"):GetComponent("Image").sprite=Util.LoadSprite(GetResourcePath(itemConfig[curequipSign.Id].ResourceID))
|
||||||
Util.GetGameObject(_go.transform,"circleFrameBg/circleFrame"):GetComponent("Image").sprite=Util.LoadSprite(SoulPrintSpriteByQuantity[itemConfig[curequipSign.Id].Quantity].circle)
|
Util.GetGameObject(_go.transform,"circleFrameBg/circleFrame"):GetComponent("Image").sprite=Util.LoadSprite(SoulPrintSpriteByQuantity[itemConfig[curequipSign.Id].Quantity].circle)
|
||||||
Util.GetGameObject(_go.transform,"circleFrameBg"):GetComponent("Image").sprite=Util.LoadSprite(SoulPrintSpriteByQuantity[itemConfig[curequipSign.Id].Quantity].circleBg2)
|
Util.GetGameObject(_go.transform,"circleFrameBg"):GetComponent("Image").sprite=Util.LoadSprite(SoulPrintSpriteByQuantity[itemConfig[curequipSign.Id].Quantity].circleBg2)
|
||||||
Util.GetGameObject(_go.transform,"name"):GetComponent("Text").text=curequipSign.Name
|
Util.GetGameObject(_go.transform,"name"):GetComponent("Text").text= string.gsub(curequipSign.Name,"魂印","",1);--curequipSign.Name
|
||||||
Util.GetGameObject(_go.transform, "UI_effect_WuCai_Kuang"):SetActive(curequipSign.Quality == 7)
|
Util.GetGameObject(_go.transform, "UI_effect_WuCai_Kuang"):SetActive(curequipSign.Quality == 7)
|
||||||
Util.AddParticleSortLayer( Util.GetGameObject(_go,"UI_effect_WuCai_Kuang/juneng_chenggong (1)"), sortingOrder - sortingOrder2 )
|
Util.AddParticleSortLayer( Util.GetGameObject(_go,"UI_effect_WuCai_Kuang/juneng_chenggong (1)"), sortingOrder - sortingOrder2 )
|
||||||
local choosed =Util.GetGameObject(_go.transform, "choosed")
|
local choosed =Util.GetGameObject(_go.transform, "choosed")
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ using GameEditor.GameEditor.PlayerBuilder;
|
||||||
using GameLogic;
|
using GameLogic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using ResUpdate;
|
using ResUpdate;
|
||||||
|
using GameCore;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace GameEditor.FrameTool {
|
namespace GameEditor.FrameTool {
|
||||||
public class BuildWindow : EditorWindow
|
public class BuildWindow : EditorWindow
|
||||||
|
|
@ -381,4 +383,158 @@ namespace GameEditor.FrameTool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//看热更大小
|
||||||
|
public class HotfixWindow : EditorWindow
|
||||||
|
{
|
||||||
|
static VersionTxt m_VersionTxt; // 热更版本
|
||||||
|
static string fixVersion;
|
||||||
|
static string fPath;
|
||||||
|
static List<ResourceFile> exDataList;
|
||||||
|
static List<ResourceFile> inDataList;
|
||||||
|
static DirectoryInfo pathInfo;
|
||||||
|
static decimal Size = 0;
|
||||||
|
static Dictionary<string, ResourceFile> inDataDic = new Dictionary<string, ResourceFile>();
|
||||||
|
|
||||||
|
[MenuItem("Build/HotfixSize")]
|
||||||
|
static void Init()
|
||||||
|
{
|
||||||
|
fixVersion = Application.dataPath + "/../AssetBundles/version.txt";
|
||||||
|
pathInfo = new DirectoryInfo(Application.dataPath);
|
||||||
|
GetExternalFile(fixVersion);
|
||||||
|
GetInternalData();
|
||||||
|
|
||||||
|
// Get existing open window or if none, make a new one:
|
||||||
|
HotfixWindow window = (HotfixWindow)EditorWindow.GetWindow(typeof(HotfixWindow));
|
||||||
|
window.titleContent = new GUIContent("热更大小");
|
||||||
|
window.Show();
|
||||||
|
}
|
||||||
|
//下载外部.unity3d文件
|
||||||
|
private static void GetExternalFile(string path)
|
||||||
|
{
|
||||||
|
//获取下载文件链接
|
||||||
|
string json = File.ReadAllText(path);
|
||||||
|
m_VersionTxt = JsonUtility.FromJson<VersionTxt>(json);
|
||||||
|
string url = m_VersionTxt.resUrl + "Android/files.unity3d";
|
||||||
|
//获取文件存放路径
|
||||||
|
fPath = pathInfo.Parent.FullName + @"\Temp";
|
||||||
|
if (File.Exists(fPath + @"\files.unity3d"))
|
||||||
|
{
|
||||||
|
File.Delete(fPath + @"\files.unity3d");
|
||||||
|
}
|
||||||
|
// 设置参数
|
||||||
|
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
|
||||||
|
//发送请求并获取相应回应数据
|
||||||
|
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
|
||||||
|
//直到request.GetResponse()程序才开始向目标网页发送Post请求
|
||||||
|
Stream responseStream = response.GetResponseStream();
|
||||||
|
//创建本地文件写入流
|
||||||
|
Stream stream = new FileStream(fPath + @"\files.unity3d", FileMode.Create, FileAccess.Write);
|
||||||
|
byte[] bArr = new byte[1024];
|
||||||
|
int size = responseStream.Read(bArr, 0, (int)bArr.Length);
|
||||||
|
while (size > 0)
|
||||||
|
{
|
||||||
|
stream.Write(bArr, 0, size);
|
||||||
|
size = responseStream.Read(bArr, 0, (int)bArr.Length);
|
||||||
|
}
|
||||||
|
stream.Close();
|
||||||
|
responseStream.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//重新下载外部.unity3d文件
|
||||||
|
private static void RegetExternalFile()
|
||||||
|
{
|
||||||
|
//获取下载文件链接
|
||||||
|
string url = m_VersionTxt.resUrl + "Android/files.unity3d";
|
||||||
|
//获取文件存放路径
|
||||||
|
fPath = pathInfo.Parent.FullName + @"\Temp";
|
||||||
|
if (File.Exists(fPath + @"\files.unity3d"))
|
||||||
|
{
|
||||||
|
File.Delete(fPath + @"\files.unity3d");
|
||||||
|
}
|
||||||
|
// 设置参数
|
||||||
|
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
|
||||||
|
//发送请求并获取相应回应数据
|
||||||
|
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
|
||||||
|
//直到request.GetResponse()程序才开始向目标网页发送Post请求
|
||||||
|
Stream responseStream = response.GetResponseStream();
|
||||||
|
//创建本地文件写入流
|
||||||
|
Stream stream = new FileStream(fPath + @"\files.unity3d", FileMode.Create, FileAccess.Write);
|
||||||
|
byte[] bArr = new byte[1024];
|
||||||
|
int size = responseStream.Read(bArr, 0, (int)bArr.Length);
|
||||||
|
while (size > 0)
|
||||||
|
{
|
||||||
|
stream.Write(bArr, 0, size);
|
||||||
|
size = responseStream.Read(bArr, 0, (int)bArr.Length);
|
||||||
|
}
|
||||||
|
stream.Close();
|
||||||
|
responseStream.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历外部unity3d数据
|
||||||
|
private static void GetExternalData()
|
||||||
|
{
|
||||||
|
UnityEngine.AssetBundle bundle = UnityEngine.AssetBundle.LoadFromFile(fPath + "\\" + UpdateConfigs.FILES);
|
||||||
|
ResourceFiles files = bundle.LoadAsset<ResourceFiles>("game");
|
||||||
|
exDataList = files.files;
|
||||||
|
bundle.Unload(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历内部unity3d数据
|
||||||
|
private static void GetInternalData()
|
||||||
|
{
|
||||||
|
UnityEngine.AssetBundle bundle = UnityEngine.AssetBundle.LoadFromFile(pathInfo.Parent.FullName + @"\AssetBundles\" + UpdateConfigs.FILES);
|
||||||
|
ResourceFiles files = bundle.LoadAsset<ResourceFiles>("game");
|
||||||
|
inDataList = files.files;
|
||||||
|
bundle.Unload(true);
|
||||||
|
inDataList.Sort(delegate (ResourceFile a, ResourceFile b) { return a.crc.CompareTo(b.crc); });
|
||||||
|
for (int i = 0; i < inDataList.Count; i++)
|
||||||
|
{
|
||||||
|
if (!inDataDic.ContainsKey(inDataList[i].fileName))
|
||||||
|
{
|
||||||
|
inDataDic.Add(inDataList[i].fileName, inDataList[i]);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
inDataDic[inDataList[i].fileName] = inDataList[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//对比数据
|
||||||
|
private static void CompareData()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < exDataList.Count; i++)
|
||||||
|
{
|
||||||
|
if (!inDataDic.ContainsKey (exDataList[i].fileName))
|
||||||
|
{
|
||||||
|
Size = exDataList[i].size + Size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Size = Size / 1048576;
|
||||||
|
UnityEngine.Debug.Log(Size + "M");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnGUI()
|
||||||
|
{
|
||||||
|
EditorGUILayout.BeginVertical();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.LabelField("线上位置:");
|
||||||
|
m_VersionTxt.resUrl = EditorGUILayout.TextField(m_VersionTxt.resUrl);
|
||||||
|
EditorGUILayout.EndVertical();
|
||||||
|
if (GUILayout.Button("重新获取files", GUILayout.Height(40f)))
|
||||||
|
{
|
||||||
|
UnityEngine.Debug.Log("URL:"+ m_VersionTxt.resUrl);
|
||||||
|
RegetExternalFile();
|
||||||
|
}
|
||||||
|
if (GUILayout.Button("对比大小", GUILayout.Height(40f)))
|
||||||
|
{
|
||||||
|
Size = 0;
|
||||||
|
GetExternalData();
|
||||||
|
CompareData();
|
||||||
|
}
|
||||||
|
|
||||||
|
string resUrl = Size.ToString("0.00") + "M";
|
||||||
|
resUrl = EditorGUILayout.TextField(resUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue