Skip to content

Commit 71ff186

Browse files
committed
v1.0.180 release
1 parent ec15743 commit 71ff186

168 files changed

Lines changed: 1845 additions & 1493 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Id": "",
3-
"Version": "v1.0.151",
3+
"Version": "v1.0.180",
44
"Type": 0,
55
"AccessRight": 0,
66
"DownloadUrl": "",
@@ -11,10 +11,10 @@
1111
],
1212
"DocUrl": "https://liangxiegame.com",
1313
"Readme": {
14-
"version": "v1.0.151",
15-
"content": "JsonObject=>JsonKit",
14+
"version": "v1.0.180",
15+
"content": "修复文档的错别字&修复文档显示问题",
1616
"author": "liangxie",
17-
"date": "2024102010:57",
17+
"date": "2025021113:10",
1818
"PackageId": ""
1919
}
2020
}

QFramework.Unity2018+/Assets/QFramework/Framework/Scripts/QFramework.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ public static void AutoRegister()
783783

784784
public interface IEasyEvent
785785
{
786-
IUnRegister Register(Action onEvent);
786+
IUnRegister Register(Action onEvent);
787787
}
788788

789789
public class EasyEvent : IEasyEvent
@@ -796,6 +796,12 @@ public IUnRegister Register(Action onEvent)
796796
return new CustomUnRegister(() => { UnRegister(onEvent); });
797797
}
798798

799+
public IUnRegister RegisterWithACall(Action onEvent)
800+
{
801+
onEvent.Invoke();
802+
return Register(onEvent);
803+
}
804+
799805
public void UnRegister(Action onEvent) => mOnEvent -= onEvent;
800806

801807
public void Trigger() => mOnEvent?.Invoke();
@@ -917,6 +923,12 @@ public IUnRegister Register(Action onEvent)
917923
return new CustomUnRegister(() => { UnRegister(onEvent); });
918924
}
919925

926+
public IUnRegister RegisterWithACall(Action onEvent)
927+
{
928+
onEvent.Invoke();
929+
return Register(onEvent);
930+
}
931+
920932
public void UnRegister(Action onEvent)
921933
{
922934
mOnEvent -= onEvent;

QFramework.Unity2018+/Assets/QFramework/Toolkits/ResKit/Editor/AssetBundleExporter.cs

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
11
/****************************************************************************
2-
* Copyright (c) 2017 snowcold
3-
* Copyright (c) 2017 ~ 2018.5 liangxie
2+
* Copyright (c) 2015 ~ 2024 liangxie
43
*
5-
* http://qframework.io
4+
* https://qframework.cn
65
* https://github.com/liangxiegame/QFramework
7-
*
8-
* Permission is hereby granted, free of charge, to any person obtaining a copy
9-
* of this software and associated documentation files (the "Software"), to deal
10-
* in the Software without restriction, including without limitation the rights
11-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
* copies of the Software, and to permit persons to whom the Software is
13-
* furnished to do so, subject to the following conditions:
14-
*
15-
* The above copyright notice and this permission notice shall be included in
16-
* all copies or substantial portions of the Software.
17-
*
18-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24-
* THE SOFTWARE.
6+
* https://gitee.com/liangxiegame/QFramework
257
****************************************************************************/
268

279
using UnityEditor;
@@ -31,12 +13,19 @@ namespace QFramework
3113
{
3214
public static class AssetBundleExporter
3315
{
34-
public static void BuildDataTable(string[] abNames = null,string outputPath = null)
16+
public static void BuildDataTable(string[] abNames = null,string outputPath = null,bool appendHash = false)
3517
{
3618
Debug.Log("Start Default BuildAssetDataTable!");
3719
var table = new ResDatas();
38-
ConfigFileUtility.AddABInfo2ResDatas(table, abNames);
20+
if (appendHash)
21+
{
22+
ConfigFileUtility.AddABInfo2ResDatasAppendHash(table, abNames);
23+
}
24+
else
25+
{
26+
ConfigFileUtility.AddABInfo2ResDatas(table, abNames);
3927

28+
}
4029
var filePath =
4130
(outputPath ?? (AssetBundlePathHelper.StreamingAssetsPath + AssetBundleSettings.RELATIVE_AB_ROOT_FOLDER)).CreateDirIfNotExists() +
4231
ResDatas.FileName;

QFramework.Unity2018+/Assets/QFramework/Toolkits/ResKit/Editor/BuildScript.cs

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
/****************************************************************************
2-
* Copyright (c) 2017 ~ 2021.4 liangxie
3-
*
4-
* http://qframework.io
5-
* https://github.com/liangxiegame/QFramework
2+
* Copyright (c) 2017 ~ 2024 liangxiegame UNDER MIT LINCESE
63
*
7-
* Permission is hereby granted, free of charge, to any person obtaining a copy
8-
* of this software and associated documentation files (the "Software"), to deal
9-
* in the Software without restriction, including without limitation the rights
10-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
* copies of the Software, and to permit persons to whom the Software is
12-
* furnished to do so, subject to the following conditions:
13-
*
14-
* The above copyright notice and this permission notice shall be included in
15-
* all copies or substantial portions of the Software.
16-
*
17-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23-
* THE SOFTWARE.
4+
* https://qframework.cn
5+
* https://github.com/liangxiegame/QFramework
6+
* https://gitee.com/liangxiegame/QFramework
247
****************************************************************************/
258

269

@@ -60,8 +43,18 @@ public static void BuildAssetBundles(BuildTarget buildTarget)
6043
var outputPath = Path.Combine(ResKitAssetsMenu.AssetBundlesOutputPath, GetPlatformName());
6144
outputPath.CreateDirIfNotExists();
6245

63-
BuildPipeline.BuildAssetBundles(outputPath, defaultSubProjectData.Builds.ToArray(),
64-
BuildAssetBundleOptions.ChunkBasedCompression, buildTarget);
46+
if (ResKitView.AppendHash)
47+
{
48+
BuildPipeline.BuildAssetBundles(outputPath, defaultSubProjectData.Builds.ToArray(),
49+
BuildAssetBundleOptions.ChunkBasedCompression | BuildAssetBundleOptions.AppendHashToAssetBundleName,
50+
buildTarget);
51+
}
52+
else
53+
{
54+
BuildPipeline.BuildAssetBundles(outputPath, defaultSubProjectData.Builds.ToArray(),
55+
BuildAssetBundleOptions.ChunkBasedCompression,
56+
buildTarget);
57+
}
6558

6659
GenerateVersionConfig();
6760

@@ -72,26 +65,26 @@ public static void BuildAssetBundles(BuildTarget buildTarget)
7265

7366
FileUtil.ReplaceDirectory(outputPath, finalDir);
7467

75-
AssetBundleExporter.BuildDataTable(defaultSubProjectData.Builds.Select(b => b.assetBundleName).ToArray());
76-
77-
foreach (var subProjectData in subProjectDatas)
78-
{
79-
outputPath = Path.Combine(ResKitAssetsMenu.AssetBundlesOutputPath + "/" + subProjectData.Name,
80-
GetPlatformName());
81-
outputPath.CreateDirIfNotExists();
82-
83-
BuildPipeline.BuildAssetBundles(outputPath, subProjectData.Builds.ToArray(),
84-
BuildAssetBundleOptions.ChunkBasedCompression, buildTarget);
85-
finalDir = Application.streamingAssetsPath + "/" + subProjectData.Name + "/AssetBundles/" +
86-
GetPlatformName();
87-
88-
finalDir.DeleteDirIfExists();
89-
finalDir.CreateDirIfNotExists();
90-
91-
FileUtil.ReplaceDirectory(outputPath, finalDir);
92-
AssetBundleExporter.BuildDataTable(subProjectData.Builds.Select(b => b.assetBundleName).ToArray(),
93-
finalDir + "/");
94-
}
68+
AssetBundleExporter.BuildDataTable(defaultSubProjectData.Builds.Select(b => b.assetBundleName).ToArray(),appendHash:ResKitView.AppendHash);
69+
70+
// foreach (var subProjectData in subProjectDatas)
71+
// {
72+
// outputPath = Path.Combine(ResKitAssetsMenu.AssetBundlesOutputPath + "/" + subProjectData.Name,
73+
// GetPlatformName());
74+
// outputPath.CreateDirIfNotExists();
75+
//
76+
// BuildPipeline.BuildAssetBundles(outputPath, subProjectData.Builds.ToArray(),
77+
// BuildAssetBundleOptions.ChunkBasedCompression, buildTarget);
78+
// finalDir = Application.streamingAssetsPath + "/" + subProjectData.Name + "/AssetBundles/" +
79+
// GetPlatformName();
80+
//
81+
// finalDir.DeleteDirIfExists();
82+
// finalDir.CreateDirIfNotExists();
83+
//
84+
// FileUtil.ReplaceDirectory(outputPath, finalDir);
85+
// AssetBundleExporter.BuildDataTable(subProjectData.Builds.Select(b => b.assetBundleName).ToArray(),
86+
// finalDir + "/");
87+
// }
9588

9689
AssetDatabase.Refresh();
9790
}

0 commit comments

Comments
 (0)