From 09a4084e4269891d717ac57a09a26a29c57fa0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JasonXuDeveloper=20-=20=E5=82=91?= Date: Mon, 11 Apr 2022 13:07:59 +1000 Subject: [PATCH 1/3] bug fix --- .../ILRuntime/ValueTypeBinders/QuaternionBinder.cs | 4 +++- .../ILRuntime/ValueTypeBinders/Vector2Binder.cs | 4 +++- .../ILRuntime/ValueTypeBinders/Vector3Binder.cs | 4 +++- .../JEngine/AntiCheat/ValueTypeBinders/JIntBinder.cs | 4 +++- .../JEngine/Editor/JEngineTools/EditorUpdates/SetData.cs | 8 ++++++++ .../Dependencies/JEngine/Editor/JEngineTools/Setting.cs | 2 +- .../JEngine/Editor/JEngineTools/UnityEditor/MenuItems.cs | 2 +- UnityProject/Assets/Dependencies/LitJson/JsonMapper.cs | 3 +++ UnityProject/Assets/Scripts/LoadILRuntime.cs | 3 +-- 9 files changed, 26 insertions(+), 8 deletions(-) diff --git a/UnityProject/Assets/Dependencies/ILRuntime/ValueTypeBinders/QuaternionBinder.cs b/UnityProject/Assets/Dependencies/ILRuntime/ValueTypeBinders/QuaternionBinder.cs index f87e1c2d..1ccb8818 100644 --- a/UnityProject/Assets/Dependencies/ILRuntime/ValueTypeBinders/QuaternionBinder.cs +++ b/UnityProject/Assets/Dependencies/ILRuntime/ValueTypeBinders/QuaternionBinder.cs @@ -1,4 +1,5 @@ -using UnityEngine; +#if INIT_JE +using UnityEngine; using System.Collections.Generic; using System; using System.Reflection; @@ -343,3 +344,4 @@ void PushVector3(ref Vector3 vec, ILIntepreter intp, StackObject* ptr, IList /// 语言 /// - private static JEngineLanguage Language + public static JEngineLanguage Language { get => (JEngineLanguage)(int.Parse(PlayerPrefs.GetString($"{_prefix}.PanelLanguage", "0"))); set => PlayerPrefs.SetString($"{_prefix}.PanelLanguage", value == JEngineLanguage.中文 ? "0" : "1"); diff --git a/UnityProject/Assets/Dependencies/JEngine/Editor/JEngineTools/UnityEditor/MenuItems.cs b/UnityProject/Assets/Dependencies/JEngine/Editor/JEngineTools/UnityEditor/MenuItems.cs index b75e69a1..49d05102 100644 --- a/UnityProject/Assets/Dependencies/JEngine/Editor/JEngineTools/UnityEditor/MenuItems.cs +++ b/UnityProject/Assets/Dependencies/JEngine/Editor/JEngineTools/UnityEditor/MenuItems.cs @@ -38,7 +38,7 @@ internal class MenuItems [MenuItem("JEngine/Open Documents",priority = 1999)] public static void OpenDocument() { - Application.OpenURL("https://xgamedev.uoyou.com"); + Application.OpenURL("https://docs.xgamedev.net/"); } [MenuItem("JEngine/Open on Github",priority = 2000)] diff --git a/UnityProject/Assets/Dependencies/LitJson/JsonMapper.cs b/UnityProject/Assets/Dependencies/LitJson/JsonMapper.cs index 3cc67b4e..9f00d34a 100644 --- a/UnityProject/Assets/Dependencies/LitJson/JsonMapper.cs +++ b/UnityProject/Assets/Dependencies/LitJson/JsonMapper.cs @@ -1102,6 +1102,8 @@ public static void UnregisterImporters () { custom_importers_table.Clear (); } + + #if INIT_JE public unsafe static void RegisterILRuntimeCLRRedirection(ILRuntime.Runtime.Enviorment.AppDomain appdomain) { @@ -1167,5 +1169,6 @@ public unsafe static void RegisterILRuntimeCLRRedirection(ILRuntime.Runtime.Envi return ILIntepreter.PushObject(__ret, mStack, result_of_this_method); } + #endif } } \ No newline at end of file diff --git a/UnityProject/Assets/Scripts/LoadILRuntime.cs b/UnityProject/Assets/Scripts/LoadILRuntime.cs index 33f3a8db..641160d7 100644 --- a/UnityProject/Assets/Scripts/LoadILRuntime.cs +++ b/UnityProject/Assets/Scripts/LoadILRuntime.cs @@ -23,10 +23,9 @@ public static void InitializeILRuntime(AppDomain appdomain) RegisterValueTypeBinderHelper.HelperRegister(appdomain); //Protobuf适配 ProtoBuf.PType.RegisterILRuntimeCLRRedirection(appdomain); -#endif - //LitJson适配 JsonMapper.RegisterILRuntimeCLRRedirection(appdomain); +#endif //CLR绑定(有再去绑定) Type t = Type.GetType("ILRuntime.Runtime.Generated.CLRBindings"); From a15e1d5472ce3cf92ba01b6d90291a0befbc39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JasonXuDeveloper=20-=20=E5=82=91?= Date: Mon, 11 Apr 2022 13:09:57 +1000 Subject: [PATCH 2/3] fixed #296 --- .../JEngine/Editor/ILRuntimeTools/ILRuntimeCrossBinding.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnityProject/Assets/Dependencies/JEngine/Editor/ILRuntimeTools/ILRuntimeCrossBinding.cs b/UnityProject/Assets/Dependencies/JEngine/Editor/ILRuntimeTools/ILRuntimeCrossBinding.cs index 513c88b5..c5824e48 100644 --- a/UnityProject/Assets/Dependencies/JEngine/Editor/ILRuntimeTools/ILRuntimeCrossBinding.cs +++ b/UnityProject/Assets/Dependencies/JEngine/Editor/ILRuntimeTools/ILRuntimeCrossBinding.cs @@ -320,7 +320,8 @@ private static string GenerateCrossBindingAdapterEditorCode(Type baseType,string "); sb.Append( @"[CustomEditor(typeof("); - sb.Append(clsName + "Adapter.Adapter"); + sb.Append((nameSpace == clsName && !string.IsNullOrEmpty(nameSpace) ? nameSpace + "." : "") + clsName + + "Adapter.Adapter"); sb.Append(@"), true)] public class "); sb.Append(clsName); From a8b090d261a4ce03b3b39bbb80dccec1eecce8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JasonXuDeveloper=20-=20=E5=82=91?= Date: Mon, 11 Apr 2022 13:14:46 +1000 Subject: [PATCH 3/3] bug fix --- .../Assets/Scripts/Helpers/RegisterValueTypeBinder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UnityProject/Assets/Scripts/Helpers/RegisterValueTypeBinder.cs b/UnityProject/Assets/Scripts/Helpers/RegisterValueTypeBinder.cs index 3d5bfb8d..3c9ef0c2 100644 --- a/UnityProject/Assets/Scripts/Helpers/RegisterValueTypeBinder.cs +++ b/UnityProject/Assets/Scripts/Helpers/RegisterValueTypeBinder.cs @@ -1,3 +1,4 @@ +#if INIT_JE using ILRuntime.Runtime.Enviorment; using JEngine.AntiCheat; using JEngine.AntiCheat.ValueTypeBinders; @@ -27,4 +28,5 @@ public void Register(AppDomain appdomain) appdomain.RegisterValueTypeBinder(typeof(JInt), new JIntBinder()); } } -} \ No newline at end of file +} +#endif \ No newline at end of file