Skip to content

Commit 4526aa2

Browse files
fix #530
fix #530
2 parents c0b0bef + fc348df commit 4526aa2

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

CHANGE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## All Versions
22

3+
## 1.0.4 (October 15 2025)
4+
5+
- **Fixed** `AddComponent<T>` and `GetComponent<T>` issue under editor
6+
37
## 1.0.3 (October 15 2025)
48

59
- **Supported** Unity CDN (UOS)

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ JEngine is a powerful Unity framework that enables **runtime hot updates** for y
5353
| **HybridCLR** | Runtime code execution | [GitHub](https://github.com/focus-creative-games/hybridclr) |
5454
| **YooAssets** | Runtime resource updates | [GitHub](https://github.com/tuyoogame/YooAsset) |
5555

56-
## 🎉 Latest Features (v1.0.3)
56+
## 🎉 Latest Features (v1.0.4)
5757

58-
- **Supported** Unity CDN (UOS)
59-
- **Optimized** WebGL asset loading throughput
58+
- **Fixed** `AddComponent<T>` and `GetComponent<T>` issue under editor
6059

6160
[📋 View Complete Changelog](CHANGE.md)
6261

README_zh_cn.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ JEngine是针对Unity开发者设计的**开箱即用**的框架,封装了强
5757
| **HybridCLR** | 运行时代码执行 | [GitHub](https://github.com/focus-creative-games/hybridclr) |
5858
| **YooAssets** | 运行时资源更新 | [GitHub](https://github.com/tuyoogame/YooAsset) |
5959

60-
## 🎉 最新功能 (v1.0.3)
60+
## 🎉 最新功能 (v1.0.4)
6161

62-
- **支持** Unity CDN (UOS)
63-
- **优化** WebGL 资源加载吞吐量
62+
- **修复**编辑器下 `AddComponent<T>``GetComponent<T>` 问题
6463

6564
[📋 查看完整更新日志](CHANGE.md)
6665

UnityProject/Packages/com.jasonxudeveloper.jengine.core/Runtime/Bootstrap.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,21 @@ await MessageBox.Show("Error", $"Scene loading failed: {exception.Message}",
309309
// Load hot update DLL
310310
updateStatusText.text = "Loading code...";
311311
#if UNITY_EDITOR
312-
// In editor, load directly from file system. Cannot read encrypted files. Encrypted files can only run on real devices.
313-
var hotUpdateDllBytes =
314-
await File.ReadAllBytesAsync($"Library/ScriptAssemblies/{hotCodeName}");
315-
var hotUpdatePdbBytes = await File.ReadAllBytesAsync(
316-
$"Library/ScriptAssemblies/{Path.ChangeExtension(hotCodeName, "pdb")}");
317-
Assembly hotUpdateAss = Assembly.Load(hotUpdateDllBytes, hotUpdatePdbBytes);
312+
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
313+
Assembly hotUpdateAss = null;
314+
foreach (var assembly in assemblies)
315+
{
316+
if (assembly.GetName().Name == Path.GetFileNameWithoutExtension(hotCodeName))
317+
{
318+
hotUpdateAss = assembly;
319+
break;
320+
}
321+
}
322+
323+
if (hotUpdateAss == null)
324+
{
325+
throw new Exception($"Hot update assembly {hotCodeName} not found in editor mode.");
326+
}
318327
#else
319328
var dllHandle =
320329
package.LoadAssetAsync<TextAsset>($"Assets/HotUpdate/Compiled/{hotCodeName}.bytes");

UnityProject/Packages/com.jasonxudeveloper.jengine.core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.jasonxudeveloper.jengine.core",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"displayName": "JEngine.Core",
55
"description": "The solution that allows unity games update in runtime.",
66
"license": "MIT",

0 commit comments

Comments
 (0)