From cfa4b120397f8369cb399ddafd162c4fab7b7392 Mon Sep 17 00:00:00 2001 From: sinaioutlander <49360850+sinaioutlander@users.noreply.github.com> Date: Mon, 23 Nov 2020 18:23:25 +1100 Subject: [PATCH] 3.0.4 see release notes --- src/ExplorerCore.cs | 13 +- src/Helpers/Texture2DHelpers.cs | 11 +- src/Inspectors/InspectorManager.cs | 17 +- src/Inspectors/MouseInspector.cs | 154 ++++++++++++++---- .../InteractiveValue/InteractiveEnum.cs | 9 +- .../InteractiveValue/InteractiveString.cs | 93 ++++++++--- .../InteractiveUnityStruct.cs | 15 +- .../InteractiveValue/InteractiveValue.cs | 18 +- src/Tests/Tests.cs | 6 + src/UI/Modules/SearchPage.cs | 5 +- src/UnityExplorer.csproj | 4 +- src/Unstrip/ResourcesUnstrip.cs | 23 +-- 12 files changed, 273 insertions(+), 95 deletions(-) diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 63de4cd..97df232 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -1,21 +1,22 @@ using System; +using System.IO; +using UnityEngine; +using UnityEngine.SceneManagement; using UnityExplorer.Config; using UnityExplorer.Input; +using UnityExplorer.Inspectors; using UnityExplorer.UI; using UnityExplorer.UI.Modules; -using UnityEngine; -using UnityExplorer.Inspectors; -using System.IO; -using UnityExplorer.Unstrip; -using UnityEngine.SceneManagement; +#if CPP using UnityExplorer.Helpers; +#endif namespace UnityExplorer { public class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "3.0.3"; + public const string VERSION = "3.0.4"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; public const string EXPLORER_FOLDER = @"Mods\UnityExplorer"; diff --git a/src/Helpers/Texture2DHelpers.cs b/src/Helpers/Texture2DHelpers.cs index a05e9e5..8aba1e4 100644 --- a/src/Helpers/Texture2DHelpers.cs +++ b/src/Helpers/Texture2DHelpers.cs @@ -35,7 +35,6 @@ namespace UnityExplorer.Helpers } #endif - public static bool IsReadable(this Texture2D tex) { try @@ -68,6 +67,10 @@ namespace UnityExplorer.Helpers return _newTex; } +#if CPP + internal delegate void d_Blit2(IntPtr source, IntPtr dest); +#endif + public static Texture2D ForceReadTexture(Texture2D tex) { try @@ -78,7 +81,13 @@ namespace UnityExplorer.Helpers var rt = RenderTexture.GetTemporary(tex.width, tex.height, 0, RenderTextureFormat.ARGB32); rt.filterMode = FilterMode.Point; RenderTexture.active = rt; + +#if MONO Graphics.Blit(tex, rt); +#else + var iCall = ICallHelper.GetICall("UnityEngine.Graphics::Blit2"); + iCall.Invoke(tex.Pointer, rt.Pointer); +#endif var _newTex = new Texture2D(tex.width, tex.height, TextureFormat.ARGB32, false); diff --git a/src/Inspectors/InspectorManager.cs b/src/Inspectors/InspectorManager.cs index 999b094..2ec0ee3 100644 --- a/src/Inspectors/InspectorManager.cs +++ b/src/Inspectors/InspectorManager.cs @@ -231,23 +231,34 @@ namespace UnityExplorer.Inspectors invisGroup.spacing = 10; // inspect under mouse button + AddMouseInspectButton(topRowObj, MouseInspector.MouseInspectMode.UI); + AddMouseInspectButton(topRowObj, MouseInspector.MouseInspectMode.World); + } + private static void AddMouseInspectButton(GameObject topRowObj, MouseInspector.MouseInspectMode mode) + { var inspectObj = UIFactory.CreateButton(topRowObj); var inspectLayout = inspectObj.AddComponent(); inspectLayout.minWidth = 120; inspectLayout.flexibleWidth = 0; + + var inspectText = inspectObj.GetComponentInChildren(); + inspectText.text = "Mouse Inspect"; + inspectText.fontSize = 13; + + if (mode == MouseInspector.MouseInspectMode.UI) + inspectText.text += " (UI)"; + var inspectBtn = inspectObj.GetComponent