Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonXuDeveloper committed Nov 10, 2020
1 parent dce45ab commit c2dfbae
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public override void OnInspectorGUI()
{
var clrInstance = ClassBind.FindObjectsOfTypeAll<MonoBehaviourAdapter.Adaptor>()
.Find(adaptor =>
adaptor.ILInstance == instance[i.Value]);
adaptor.ILInstance.Equals(instance[i.Value]));
if (clrInstance != null)
{
GUI.enabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ private void OnGUI()
GUI.skin.label.fontSize = 18;
GUILayout.Label("ILRuntime Adapter Generator");

//介绍
EditorGUILayout.HelpBox("本地工程类(没生成asmdef的),Assembly一栏不需要改,Class name一栏写类名(有命名空间带上);\n" +
"有生成asmdef的工程类,Assembly一栏写asmdef里写的名字,Class name一栏写类名(有命名空间带上);\n" +
"最后的Namespace是生成的适配器的命名空间,随便写,只要在适配器Helper引用激活即可\n\n" +
"如果要生成Unity类的适配器,请确定找到了对应的module,并添加进热更工程,HotUpdateScripts/Dlls文件夹内,不然无法获取",MessageType.Info);

//程序集
GUILayout.Space(50);
GUILayout.BeginHorizontal();
GUILayout.Space(25);
EditorGUILayout.LabelField("Assembly 适配器命名空间");
EditorGUILayout.LabelField("Assembly 类的程序集");
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Space(25);
Expand All @@ -86,7 +92,6 @@ private void OnGUI()
GUILayout.Space(10);
GUILayout.BeginHorizontal();
GUILayout.Space(25);
_namespace = "ProjectAdapter";
EditorGUILayout.LabelField("Namespace for generated adapter 生成适配器的命名空间");
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
Expand Down Expand Up @@ -117,6 +122,15 @@ private void GenAdapter()
t = Assembly
.LoadFile(new DirectoryInfo(Application.dataPath).Parent?.FullName +
$"/Library/ScriptAssemblies/{_assembly}.dll").GetType(_class);

if (t == null)
{


t = Assembly
.LoadFile(new DirectoryInfo(Application.dataPath).Parent?.FullName +
$"/HotUpdateScripts/Dlls/{_assembly}.dll").GetType(_class);
}
}

//判断空
Expand All @@ -125,9 +139,9 @@ private void GenAdapter()
EditorUtility.DisplayDialog("Error", $"Invalid Class {_class}!\r\n{_class}类不存在!", "Ok");
return;
}

_class = t.FullName.Replace(".","_");

_class = t.FullName.Replace(".","_");

if (!Directory.Exists(OUTPUT_PATH))
{
Directory.CreateDirectory(OUTPUT_PATH);
Expand Down
8 changes: 0 additions & 8 deletions UnityProject/Assets/Dependencies/JEngine/UI.meta

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 6 additions & 1 deletion UnityProject/HotUpdateScripts/JEngine/Core/JBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,13 @@ public JBehaviour Activate()
/// Launch the lifecycle
/// 开始生命周期
/// </summary>
private protected void Launch()
private protected async void Launch()
{
if (!_gameObject.activeSelf)
{
await Task.Delay(10);
}

Stopwatch sw = new Stopwatch();
sw.Start();
try
Expand Down

0 comments on commit c2dfbae

Please sign in to comment.