diff --git a/.gitignore b/.gitignore
index b64d3326..d3b88754 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,6 @@ UnityProject/Build/*
UnityProject/HotUpdateScripts/.idea/*
UnityProject/Assets/JEngine.proj
UnityProject/Assets/JEngine.proj.meta
+/UnityProject/Host
+/UnityProject/yoo
+/UnityProject/UserSettings/Layouts
diff --git a/README.md b/README.md
index 65ffcbbf..d14a7307 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@
-# JENGINE v0.8.0f7
+# JENGINE v1.0 dev

@@ -51,7 +51,7 @@ The ``development`` branch is the development branch. You are welcome to make ch
## Requirement
-- **Unity 2020.3.4+**
+- **Unity 2021.3.2+**
- .net framework 4.x / .net 4.x / net framework
## Packages
@@ -74,7 +74,7 @@ Different built-in and additional packages for JEngine
## Dependencies
- [ILRuntime](https://github.com/Ourpalm/ILRuntime) v2.1.0 - execute C# code in runtime
-- [YooAssets](https://github.com/tuyoogame/YooAsset) v1.4.10 - update resource in runtime
+- [YooAssets](https://github.com/tuyoogame/YooAsset) v2.1.2 - update resource in runtime
- [Unity-Reorderable-List](https://github.com/cfoulston/Unity-Reorderable-List) v1.0.1 - additional editor inspector tool
@@ -91,24 +91,12 @@ Different built-in and additional packages for JEngine
-## v0.8.0 New Features
-
-- **Supported** WebGL
-- **Removed** JUI (will be redesigned shortly)
-- **Optimized** LifeCycleMgr performance
-- **Optimized** ThreadMgr features
-- **Optimized** JStream performance
-- **Optimized** JBehaviour performance
-- **Optimized** MonoBehaviour performance
-- **Optimized** FpsMonitor performance
-- **Optimized** CryptoMgr interfaces
-- **Optimized** JBehaviour/ClassBind Object/MonoBehaviour GC
-- **Optimized** GetComponent(s)/FindObject(s)OfType performance
-- **Switched** to YooAsset for asset management module (instead of Bundle Master)
-- **NEW FEATURE** UnsafeMgr which provides unsafe (use for optimization) features
-- **NEW FEATURE** UnmanagedMemoryPool which supports allocating unmanaged memory with pooling
-- **NEW FEATURE** CoroutineMgr which supports executing/stopping coroutines from non-MonoBehaviour class
-- **NEW STRUCTURE** Split JEngine source code to multiple packages
+## v0.1.0 New Features
+
+- Support **Hot Update Resource Encryption**
+- Significantly optimised **Hot Update Code Dynamic Decryption Performance**
+- Significantly optimised **Hot Update Code Launch Speed**
+- Optimised **Hot Update Code File Watcher Performance in Editor Mode**
[Click here to see the change log](CHANGE.md)
diff --git a/README_zh_cn.md b/README_zh_cn.md
index 361e9a1a..5aa53d02 100644
--- a/README_zh_cn.md
+++ b/README_zh_cn.md
@@ -30,7 +30,7 @@
-# JENGINE v0.8.0f7
+# JENGINE v1.0 开发版
JEngine是针对Unity开发者设计的**开箱即用**的框架,封装了强大的功能,小白也能**快速上手**,**轻松制作**可以**热更新的游戏**
@@ -70,7 +70,7 @@ JEngine是针对Unity开发者设计的**开箱即用**的框架,封装了强
## 使用要求
-- **Unity 2020.3.4+**
+- **Unity 2021.3.2+**
- .net framework 4.x / .net 4.x / net framework
## 功能包
@@ -93,7 +93,7 @@ JEngine不同的自带和额外的功能包
## 依赖项目
- [ILRuntime](https://github.com/Ourpalm/ILRuntime) v2.1.0 - 运行时执行C#代码
-- [YooAssets](https://github.com/tuyoogame/YooAsset) v1.4.10 - 运行时更新资源
+- [YooAssets](https://github.com/tuyoogame/YooAsset) v2.1.2 - 运行时更新资源
- [Unity-Reorderable-List](https://github.com/cfoulston/Unity-Reorderable-List) v1.0.1 - 额外编辑器控件
@@ -127,39 +127,15 @@ JEngine不同的自带和额外的功能包
-## v0.8.0 最新功能
+## v0.1.0 最新功能
-- **支持** WebGL
+- 支持**热更资源加密**
-- **移除** JUI(过段时间会重构)
+- 大幅优化**热更代码动态解密性能**
-- **优化** LifeCycleMgr 性能
+- 大幅优化**热更代码启动速度**
-- **优化** ThreadMgr 功能
-
-- **优化** JStream 性能
-
-- **优化** JBehaviour 性能
-
-- **优化** MonoBehaviour 性能
-
-- **优化** FpsMonitor 性能
-
-- **优化** CryptoMgr 接口
-
-- **优化** JBehaviour/ClassBind Object/MonoBehaviour GC
-
-- **优化** GetComponent(s)/FindObject(s)OfType 性能
-
-- **切换** 到 YooAsset作为热更资源管理 (弃用Bundle Master)
-
-- **新功能** UnsafeMgr 提供不安全(用于性能优化)功能
-
-- **新功能** UnmanagedMemoryPool 提供非托管内存池功能
-
-- **新功能** CoroutineMgr提供在非MonoBehaviour类型内使用携程的功能
-
-- **新架构** 将JEngine源码分成不同的模块,核心代码更轻量!
+- 优化**编辑器下监听热更代码变动性能**
[点击此处查看历史版本功能(英文)](CHANGE.md)
diff --git a/UnityProject/Assembly-CSharp-Editor.csproj.DotSettings b/UnityProject/Assembly-CSharp-Editor.csproj.DotSettings
index 12b2aba1..bfeb2a26 100644
--- a/UnityProject/Assembly-CSharp-Editor.csproj.DotSettings
+++ b/UnityProject/Assembly-CSharp-Editor.csproj.DotSettings
@@ -1,3 +1,6 @@
+ True
True
+ True
+ True
True
\ No newline at end of file
diff --git a/UnityProject/Assembly-CSharp.csproj.DotSettings b/UnityProject/Assembly-CSharp.csproj.DotSettings
index 26e51b22..2295314b 100644
--- a/UnityProject/Assembly-CSharp.csproj.DotSettings
+++ b/UnityProject/Assembly-CSharp.csproj.DotSettings
@@ -1,4 +1,5 @@
+ True
True
True
True
diff --git a/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs b/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs
deleted file mode 100644
index 56cab35e..00000000
--- a/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using ILRuntime.Runtime.Enviorment;
-using AppDomain = ILRuntime.Runtime.Enviorment.AppDomain;
-
-namespace JEngine.Core
-{
- public class RegisterAdaptors : IRegisterHelper
- {
- public void Register(AppDomain appdomain)
- {
- //自动注册一波,无需再手动添加了,如果想要性能也可以手动自己加
- var assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
- var ilRuntimeAssembly = typeof(AppDomain).Assembly;
- var crossBindingAdaptorType = typeof(CrossBindingAdaptor);
- //全部程序集
- foreach (var assembly in assemblies)
- {
- //跳过ILRuntime的程序集
- if (assembly == ilRuntimeAssembly) continue;
- var types = assembly.GetTypes();
- //全部类型
- foreach (var type in types)
- {
- if (type.IsSubclassOf(crossBindingAdaptorType))
- {
- object obj = Activator.CreateInstance(type);
- CrossBindingAdaptor adaptor = obj as CrossBindingAdaptor;
- if (adaptor == null)
- {
- continue;
- }
-
- try
- {
- appdomain.RegisterCrossBindingAdaptor(adaptor);
- }
- catch
- {
- //ignore
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs.meta b/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs.meta
deleted file mode 100644
index 563c8332..00000000
--- a/UnityProject/Assets/Dependencies/JEngine/Core/ILRuntimeHelper/RegisterAdaptors.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0e6b6a55d1d54ac0ba3f3c7abafd2630
-timeCreated: 1664708217
\ No newline at end of file
diff --git a/UnityProject/Assets/Dependencies/JEngine/Core/Manager/AssetMgr.cs b/UnityProject/Assets/Dependencies/JEngine/Core/Manager/AssetMgr.cs
index e715283d..5e6471de 100644
--- a/UnityProject/Assets/Dependencies/JEngine/Core/Manager/AssetMgr.cs
+++ b/UnityProject/Assets/Dependencies/JEngine/Core/Manager/AssetMgr.cs
@@ -76,13 +76,15 @@ public static string GetPlatform
///
/// 初始化资源包
///
- ///
- private static async Task SetUpPackage(string packageName)
+ /// 包名
+ /// 默认管线
+ /// 是否加密
+ private static async Task SetUpPackage(string packageName, EDefaultBuildPipeline pipeline, bool encrypted)
{
string resourceUrl = Updater.ResourceUrl;
string fallbackUrl = Updater.FallbackUrl;
// 更新URL
- string end = $"/{GetPlatform}/{packageName}";
+ string end = $"/{GetPlatform}/{packageName}/";
if (!resourceUrl.EndsWith(end)) resourceUrl = $"{resourceUrl}{end}";
if (!fallbackUrl.EndsWith(end)) fallbackUrl = $"{fallbackUrl}{end}";
// 创建默认的资源包
@@ -99,18 +101,28 @@ private static async Task SetUpPackage(string packageName)
}
// 初始化
+ var decryptionServices = encrypted ? new FileOffsetDecryption() : null;
InitializeParameters initParameters = Updater.Mode switch
{
UpdateMode.Simulate => new EditorSimulateModeParameters()
{
- SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(packageName)
+ SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(
+ pipeline, packageName)
+ },
+ UpdateMode.Standalone => new OfflinePlayModeParameters()
+ {
+ DecryptionServices = decryptionServices
},
- UpdateMode.Standalone => new OfflinePlayModeParameters(),
UpdateMode.Remote => new HostPlayModeParameters()
{
- QueryServices = new QueryStreamingAssetsFileServices(),
- DefaultHostServer = resourceUrl,
- FallbackHostServer = fallbackUrl
+ BuildinQueryServices = new GameQueryServices(),
+ RemoteServices = new RemoteServices(resourceUrl, fallbackUrl),
+ DecryptionServices = decryptionServices
+ },
+ UpdateMode.WebGL => new WebPlayModeParameters()
+ {
+ BuildinQueryServices = new GameQueryServices(),
+ RemoteServices = new RemoteServices(resourceUrl, fallbackUrl),
},
_ => null
};
@@ -122,11 +134,14 @@ private static async Task SetUpPackage(string packageName)
/// 下载包
///
/// 包名
+ /// 是否加密
+ /// 资源管线(原生文件的资源包构建模式必须是RawFileBuildPipeline)
/// 回调事件
- public static async Task UpdatePackage(string packageName, IUpdater updater = null)
+ public static async Task UpdatePackage(string packageName, bool encrypted = true,
+ EDefaultBuildPipeline pipeline = EDefaultBuildPipeline.BuiltinBuildPipeline, IUpdater updater = null)
{
// 检查资源包
- await SetUpPackage(packageName);
+ await SetUpPackage(packageName, pipeline, encrypted);
// 释放UI
MessageBox.Dispose();
// 版本信息
@@ -284,12 +299,12 @@ private static ResourcePackage GetPackage(string packageName)
public static Object Load(string path, Type type) => Load(path, Updater.MainPackageName, type, out _);
- public static Object Load(string path, Type type, out AssetOperationHandle handle) =>
+ public static Object Load(string path, Type type, out AssetHandle handle) =>
Load(path, Updater.MainPackageName, type, out handle);
public static Object Load(string path, string package, Type type) => Load(path, package, type, out _);
- public static Object Load(string path, string package, Type type, out AssetOperationHandle handle)
+ public static Object Load(string path, string package, Type type, out AssetHandle handle)
{
handle = GetPackage(package).LoadAssetSync(path, type);
return handle.AssetObject;
@@ -298,13 +313,13 @@ public static Object Load(string path, string package, Type type, out AssetOpera
public static T Load(string path)
where T : Object => Load(path, Updater.MainPackageName, out _);
- public static T Load(string path, out AssetOperationHandle handle)
+ public static T Load(string path, out AssetHandle handle)
where T : Object => Load(path, Updater.MainPackageName, out handle);
public static T Load(string path, string package)
where T : Object => Load(path, package, out _);
- public static T Load(string path, string package, out AssetOperationHandle handle)
+ public static T Load(string path, string package, out AssetHandle handle)
where T : Object
{
handle = GetPackage(package).LoadAssetSync(path);
@@ -322,31 +337,32 @@ public static async Task LoadAsync(string path, string package)
return handle.AssetObject as T;
}
- public static async Task