From 1738eedb92061fc825b5bed9cac6fdbe3e811e17 Mon Sep 17 00:00:00 2001 From: VISTALL Date: Sat, 24 Oct 2020 13:56:05 +0300 Subject: [PATCH 01/17] add project files which igred --- .consulo/compiler.xml | 10 ++ .consulo/copyright/profiles_settings.xml | 5 + .consulo/dictionaries/VISTALL.xml | 3 + .consulo/misc.xml | 41 ++++++++ .consulo/modules.xml | 33 ++++++ .consulo/uiDesigner.xml | 124 +++++++++++++++++++++++ .consulo/vcs.xml | 6 ++ .gitignore | 6 +- .npmignore | 3 +- 9 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 .consulo/compiler.xml create mode 100644 .consulo/copyright/profiles_settings.xml create mode 100644 .consulo/dictionaries/VISTALL.xml create mode 100644 .consulo/misc.xml create mode 100644 .consulo/modules.xml create mode 100644 .consulo/uiDesigner.xml create mode 100644 .consulo/vcs.xml diff --git a/.consulo/compiler.xml b/.consulo/compiler.xml new file mode 100644 index 0000000..6588eac --- /dev/null +++ b/.consulo/compiler.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.consulo/copyright/profiles_settings.xml b/.consulo/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/.consulo/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.consulo/dictionaries/VISTALL.xml b/.consulo/dictionaries/VISTALL.xml new file mode 100644 index 0000000..2555bec --- /dev/null +++ b/.consulo/dictionaries/VISTALL.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.consulo/misc.xml b/.consulo/misc.xml new file mode 100644 index 0000000..aa04165 --- /dev/null +++ b/.consulo/misc.xml @@ -0,0 +1,41 @@ + + + + + + + \ No newline at end of file diff --git a/.consulo/modules.xml b/.consulo/modules.xml new file mode 100644 index 0000000..8b95580 --- /dev/null +++ b/.consulo/modules.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.consulo/uiDesigner.xml b/.consulo/uiDesigner.xml new file mode 100644 index 0000000..4f4ba57 --- /dev/null +++ b/.consulo/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.consulo/vcs.xml b/.consulo/vcs.xml new file mode 100644 index 0000000..fa851f7 --- /dev/null +++ b/.consulo/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 859bcba..9a521d0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ -.consulo/ *.csproj *.unityproj *.sln @@ -57,4 +56,7 @@ sysinfo.txt *.unitypackage # Crashlytics generated file -crashlytics-build.properties \ No newline at end of file +crashlytics-build.properties + +.consulo/workspace.xml +Managed/ \ No newline at end of file diff --git a/.npmignore b/.npmignore index 7af4a4c..bb23b17 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ lib/ -.consulo/ \ No newline at end of file +.consulo/ +Managed/ \ No newline at end of file From bdc46d747a693b11f81245f9d2f68d3537c92c06 Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Sat, 24 Oct 2020 14:28:34 +0300 Subject: [PATCH 02/17] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aee4fc2..4a3bfb8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Need add package to package list in `manifest.json` { "scopedRegistries": [ { - "name": "Main", + "name": "consulo.io", "url": "http://upm.consulo.io/", "scopes": [ "com.consulo" @@ -28,7 +28,7 @@ Need add package to package list in `manifest.json` { "scopedRegistries": [ { - "name": "Main", + "name": "consulo.io", "url": "https://upm.consulo.io/", "scopes": [ "com.consulo" @@ -39,4 +39,4 @@ Need add package to package list in `manifest.json` "com.consulo.ide": "2.2.0" } } -``` \ No newline at end of file +``` From 090b46f035be08259d5a3ed68c9aea6802c5ff0b Mon Sep 17 00:00:00 2001 From: VISTALL Date: Fri, 13 Nov 2020 09:41:13 +0300 Subject: [PATCH 03/17] disable socket searching by default allow SetForegroundWindow for windows from Consulo. Test --- CHANGELOG.md.meta | 7 +- Editor.meta | 8 ++- Editor/Consulo.meta | 8 ++- Editor/Consulo/ConsuloIntegration.cs | 64 ++++++++----------- Editor/Consulo/OSFamily.cs | 10 +++ Editor/Consulo/OSFamily.cs.meta | 11 ++++ Editor/Consulo/PluginConstants.cs | 2 +- .../Unity.com.consulo.ide.Editor.asmdef.meta | 7 +- Editor/Consulo/UnityUtil.cs | 15 +++++ Editor/Consulo/User32Dll.cs | 58 +++++++++++++++++ Editor/Consulo/User32Dll.cs.meta | 11 ++++ LICENSE.md.meta | 7 +- NOTICE.txt | 1 + NOTICE.txt.meta | 7 ++ README.md.meta | 7 +- package.json | 6 +- package.json.meta | 7 +- 17 files changed, 185 insertions(+), 51 deletions(-) create mode 100644 Editor/Consulo/OSFamily.cs create mode 100644 Editor/Consulo/OSFamily.cs.meta create mode 100644 Editor/Consulo/User32Dll.cs create mode 100644 Editor/Consulo/User32Dll.cs.meta create mode 100644 NOTICE.txt create mode 100644 NOTICE.txt.meta diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta index f1fe06b..2180045 100644 --- a/CHANGELOG.md.meta +++ b/CHANGELOG.md.meta @@ -1,2 +1,7 @@ fileFormatVersion: 2 -guid: d7263f1482bc4e2289efe6f2e383e913 \ No newline at end of file +guid: d7263f1482bc4e2289efe6f2e383e913 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor.meta b/Editor.meta index e3ebf18..b31733e 100644 --- a/Editor.meta +++ b/Editor.meta @@ -1,2 +1,8 @@ fileFormatVersion: 2 -guid: 107d219d70004926a9a5ab06fe241b25 \ No newline at end of file +guid: 107d219d70004926a9a5ab06fe241b25 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Consulo.meta b/Editor/Consulo.meta index bf77426..087c577 100644 --- a/Editor/Consulo.meta +++ b/Editor/Consulo.meta @@ -1,2 +1,8 @@ fileFormatVersion: 2 -guid: eb86f2f5bdd4407aa28051bfd46d107e \ No newline at end of file +guid: eb86f2f5bdd4407aa28051bfd46d107e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index 3b111a8..4604adb 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -42,6 +42,7 @@ public class ConsuloIntegration private static int ourLastCheckCacheTime = 5000; private static int ourLastCheck = -1; private static bool ourLastCheckResult; + private static int ourLastCheckedProcessId = -1; private static string EditorScriptApp { get @@ -129,7 +130,7 @@ static bool OnOpenedAssetCallback(int instanceID, int line) jsonClass.Add("contentType", new JSONData(selected.GetType().ToString())); jsonClass.Add("line", new JSONData(line)); - SendToConsulo("unityOpenFile", jsonClass, true); + SendToConsulo("unityOpenFile", jsonClass, true, true); return true; } @@ -138,8 +139,9 @@ static bool OnOpenedAssetCallback(int instanceID, int line) /// /// /// + /// Focus app /// Only true if user double click on file - public static void SendToConsulo(string url, JSONClass jsonClass, bool start = false) + public static void SendToConsulo(string url, JSONClass jsonClass, bool focus = false, bool start = false) { if(UnityUtil.IsDebugEnabled()) { @@ -164,7 +166,7 @@ public static void SendToConsulo(string url, JSONClass jsonClass, bool start = f { try { - SendRequestToConsulo(url, jsonClass); + SendRequestToConsulo(url, jsonClass, focus); } catch(Exception e) { @@ -175,7 +177,7 @@ public static void SendToConsulo(string url, JSONClass jsonClass, bool start = f { if(start) { - StartConsulo(url, jsonClass); + StartConsulo(url, jsonClass, focus); } } } @@ -185,13 +187,25 @@ public static void SendToConsulo(string url, JSONClass jsonClass, bool start = f } } - #if UNITY_2017_2_OR_NEWER - private static void SendRequestToConsulo(string url, JSONClass jsonClass) + private static void SendRequestToConsulo(string url, JSONClass jsonClass, bool focus) { System.Collections.IEnumerator e = SendRequestToConsuloImpl(url, jsonClass); while(e.MoveNext()) { } + + if(focus) + { + switch(UnityUtil.OSFamily) + { + case OSFamily.Windows: + if(ourLastCheckedProcessId != -1) + { + User32Dll.AllowSetForegroundWindow(ourLastCheckedProcessId); + } + break; + } + } } private static System.Collections.IEnumerator SendRequestToConsuloImpl(string url, JSONClass jsonClass) @@ -211,37 +225,6 @@ private static System.Collections.IEnumerator SendRequestToConsuloImpl(string ur throw new Exception(post.error); } } - #else - private static void SendRequestToConsulo(string url, JSONClass jsonClass) - { - WebRequest request = WebRequest.Create("http://localhost:" + PluginConstants.ourPort + "/api/" + url); - request.Timeout = ourTimeout; - request.Method = "POST"; - request.ContentType = "application/json; charset=utf-8"; - - WebRequestState state = new WebRequestState - { - Request = request, - Json = jsonClass.ToString(), - }; - - request.BeginGetRequestStream(new AsyncCallback(WriteCallback), state); - } - - private static void WriteCallback(IAsyncResult asynchronousResult) - { - WebRequestState state = (WebRequestState) asynchronousResult.AsyncState; - - using (Stream streamResponse = state.Request.EndGetRequestStream(asynchronousResult)) - { - byte[] bytes = Encoding.UTF8.GetBytes(state.Json); - - streamResponse.Write(bytes, 0, bytes.Length); - } - - state.Finished = true; - } - #endif private static bool IsConsuloStarted(bool useTimeCheck = false) { @@ -257,6 +240,7 @@ private static bool IsConsuloStarted(bool useTimeCheck = false) ourLastCheck = tickCount; } + ourLastCheckedProcessId = -1; ourLastCheckResult = false; try @@ -267,6 +251,8 @@ private static bool IsConsuloStarted(bool useTimeCheck = false) string processName = process.ProcessName.ToLowerInvariant(); if(processName.Contains("consulo")) { + ourLastCheckedProcessId = process.Id; + return ourLastCheckResult = true; } } @@ -293,7 +279,7 @@ private static bool IsConsuloStarted(bool useTimeCheck = false) return false; } - private static void StartConsulo(string url, JSONClass jsonClass) + private static void StartConsulo(string url, JSONClass jsonClass, bool focus) { Process process = new Process(); string scriptApp = EditorScriptApp; @@ -329,7 +315,7 @@ private static void StartConsulo(string url, JSONClass jsonClass) try { - SendRequestToConsulo(url, jsonClass); + SendRequestToConsulo(url, jsonClass, focus); break; } catch diff --git a/Editor/Consulo/OSFamily.cs b/Editor/Consulo/OSFamily.cs new file mode 100644 index 0000000..dd92155 --- /dev/null +++ b/Editor/Consulo/OSFamily.cs @@ -0,0 +1,10 @@ +namespace Consulo.Internal.UnityEditor +{ + internal enum OSFamily + { + Windows, + macOS, + Linux, + Other + } +} \ No newline at end of file diff --git a/Editor/Consulo/OSFamily.cs.meta b/Editor/Consulo/OSFamily.cs.meta new file mode 100644 index 0000000..94cd225 --- /dev/null +++ b/Editor/Consulo/OSFamily.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d565c5e45d2c24f4290a18a063f2b65b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Consulo/PluginConstants.cs b/Editor/Consulo/PluginConstants.cs index 4519d99..5216c14 100644 --- a/Editor/Consulo/PluginConstants.cs +++ b/Editor/Consulo/PluginConstants.cs @@ -22,7 +22,7 @@ internal class PluginConstants { internal const string ourDialogTitle = "Consulo Plugin"; internal const string ourSocketSearchingKey = "consuloEnableSocketSearching"; - internal const bool ourSocketSearchingValue = true; + internal const bool ourSocketSearchingValue = false; internal const int ourPort = 62242; //internal const int ourPort = 55333; // dev port } diff --git a/Editor/Consulo/Unity.com.consulo.ide.Editor.asmdef.meta b/Editor/Consulo/Unity.com.consulo.ide.Editor.asmdef.meta index 0e038af..6ca0224 100644 --- a/Editor/Consulo/Unity.com.consulo.ide.Editor.asmdef.meta +++ b/Editor/Consulo/Unity.com.consulo.ide.Editor.asmdef.meta @@ -1,2 +1,7 @@ fileFormatVersion: 2 -guid: 334ca48313044c73ab431bee141e6ae9 \ No newline at end of file +guid: 334ca48313044c73ab431bee141e6ae9 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Consulo/UnityUtil.cs b/Editor/Consulo/UnityUtil.cs index 011f8cb..48b7c71 100644 --- a/Editor/Consulo/UnityUtil.cs +++ b/Editor/Consulo/UnityUtil.cs @@ -22,6 +22,21 @@ namespace Consulo.Internal.UnityEditor { internal class UnityUtil { + internal static OSFamily OSFamily = FindOSFamily(); + + private static OSFamily FindOSFamily() + { + var os = Environment.OSVersion; + + if(os.VersionString.Contains("Windows")) + { + return OSFamily.Windows; + } + + // TODO [VISTALL] macOS/Linux check need? + return OSFamily.Other; + } + internal static void RunInMainThread(Action action) { EditorApplication.CallbackFunction callback = null; diff --git a/Editor/Consulo/User32Dll.cs b/Editor/Consulo/User32Dll.cs new file mode 100644 index 0000000..a0ebd75 --- /dev/null +++ b/Editor/Consulo/User32Dll.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Consulo.Internal.UnityEditor +{ + // https://github.com/JetBrains/resharper-unity/blob/net203/unity/EditorPlugin/NonUnity/User32Dll.cs + // Apache 2 License + public static class User32Dll + { + /// + /// Gets the ID of the process that owns the window. + /// Note that creating a wrapper for that is very expensive because it causes an enumeration of all the system processes to happen. + /// + public static int GetWindowProcessId(IntPtr hwnd) + { + uint dwProcessId; + GetWindowThreadProcessId(hwnd, out dwProcessId); + return unchecked((int) dwProcessId); + } + + /// + /// Lists the handles of all the top-level windows currently available in the system. + /// + public static List GetTopLevelWindowHandles() + { + var retval = new List(); + EnumWindowsProc callback = (hwnd, param) => + { + retval.Add(hwnd); + return 1; + }; + EnumWindows(Marshal.GetFunctionPointerForDelegate(callback), IntPtr.Zero); + GC.KeepAlive(callback); + return retval; + } + + public delegate int EnumWindowsProc(IntPtr hwnd, IntPtr lParam); + + [DllImport("user32.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)] + public static extern int EnumWindows(IntPtr lpEnumFunc, IntPtr lParam); + + [DllImport("user32.dll", SetLastError = true)] + private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); + + [DllImport("user32.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)] + public static extern int SetForegroundWindow(IntPtr hWnd); + + [DllImport("user32.dll")] + public static extern bool AllowSetForegroundWindow(int dwProcessId); + + [DllImport("user32.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)] + public static extern uint ShowWindow(IntPtr hWnd, int nCmdShow); + + [DllImport("User32.dll")] + public static extern bool IsIconic(IntPtr handle); + } +} \ No newline at end of file diff --git a/Editor/Consulo/User32Dll.cs.meta b/Editor/Consulo/User32Dll.cs.meta new file mode 100644 index 0000000..4690535 --- /dev/null +++ b/Editor/Consulo/User32Dll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17c7b59329882bb4f8c0270f37b18d97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LICENSE.md.meta b/LICENSE.md.meta index 6709c4b..8c4b225 100644 --- a/LICENSE.md.meta +++ b/LICENSE.md.meta @@ -1,2 +1,7 @@ fileFormatVersion: 2 -guid: f6b94658802b4c49a7f6b05c3a65bfe7 \ No newline at end of file +guid: f6b94658802b4c49a7f6b05c3a65bfe7 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..29461b8 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1 @@ +Contains some from https://github.com/JetBrains/resharper-unity Apache 2 \ No newline at end of file diff --git a/NOTICE.txt.meta b/NOTICE.txt.meta new file mode 100644 index 0000000..3d72411 --- /dev/null +++ b/NOTICE.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6da32d56a15b2734d8942c472e740a70 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta index 5ba2930..bf89cf3 100644 --- a/README.md.meta +++ b/README.md.meta @@ -1,2 +1,7 @@ fileFormatVersion: 2 -guid: 9007b5d4b05a474883374a6fa0d7a38d \ No newline at end of file +guid: 9007b5d4b05a474883374a6fa0d7a38d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index ad09b6c..20ab7db 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,8 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.2.0", + "version": "2.3.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", - "license": "Apache-2.0", - "unity": "2018.0", - "unityRelease": "0a12" + "license": "Apache-2.0" } \ No newline at end of file diff --git a/package.json.meta b/package.json.meta index e374803..46dbf5d 100644 --- a/package.json.meta +++ b/package.json.meta @@ -1,2 +1,7 @@ fileFormatVersion: 2 -guid: 99cb47334480420084b52607dec950e8 \ No newline at end of file +guid: 99cb47334480420084b52607dec950e8 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 03bab002b201f4b001630bf2e8e91401e680e51e Mon Sep 17 00:00:00 2001 From: VISTALL Date: Fri, 13 Nov 2020 13:22:08 +0300 Subject: [PATCH 04/17] rework starting Consulo with api calls, require last platform --- Editor/Consulo/ConsuloIntegration.cs | 37 ++++++++-------------------- package.json | 2 +- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index 4604adb..dd0369a 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -281,18 +281,26 @@ private static bool IsConsuloStarted(bool useTimeCheck = false) private static void StartConsulo(string url, JSONClass jsonClass, bool focus) { + JSONClass apiCall = new JSONClass(); + apiCall.Add("url", "/api/" + url); + apiCall.Add("body", jsonClass); + + string jsonFilePath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".json"; + + File.WriteAllText(jsonFilePath, apiCall.ToString()); + Process process = new Process(); string scriptApp = EditorScriptApp; if(new FileInfo(scriptApp).Extension == ".app") { process.StartInfo.FileName = "open"; - process.StartInfo.Arguments = string.Format("-n {0}{1}{0} --args {2}", "\"", "/" + scriptApp, "--no-recent-projects"); + process.StartInfo.Arguments = string.Format("-n {0}{1}{0} --args {2}", "\"", "/" + scriptApp, "--no-recent-projects --json " + jsonFilePath); } else { process.StartInfo.FileName = scriptApp; - process.StartInfo.Arguments = "--no-recent-projects"; + process.StartInfo.Arguments = "--no-recent-projects --json " + jsonFilePath; process.StartInfo.WorkingDirectory = Directory.GetParent(scriptApp).FullName; } @@ -301,31 +309,6 @@ private static void StartConsulo(string url, JSONClass jsonClass, bool focus) process.StartInfo.CreateNoWindow = true; process.StartInfo.RedirectStandardOutput = true; process.Start(); - - - Thread thread = new Thread(() => - { - for(int i = 0; i < 60; i++) - { - if(!IsConsuloStarted()) - { - Thread.Sleep(500); - continue; - } - - try - { - SendRequestToConsulo(url, jsonClass, focus); - break; - } - catch - { - Thread.Sleep(500); - } - } - }); - thread.Name = "Sending request to Consulo"; - thread.Start(); } } } \ No newline at end of file diff --git a/package.json b/package.json index 20ab7db..4a82a18 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.3.0", + "version": "2.4.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", "license": "Apache-2.0" From ef186ff913c071ecfc83168adad3bdd298c72a93 Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Thu, 19 Nov 2020 15:33:54 +0300 Subject: [PATCH 05/17] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 4a3bfb8..249388e 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,13 @@ Need add package to package list in `manifest.json` } } ``` + +## For advanced users + +Can use as git repository. but be careful, master is dev branch + +```json + "dependencies": { + "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git" + } +``` From 755e449012074ec2fe1102b35ec4146e8908ae3c Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Thu, 19 Nov 2020 15:34:29 +0300 Subject: [PATCH 06/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 249388e..9bbf959 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Need add package to package list in `manifest.json` ## For advanced users -Can use as git repository. but be careful, master is dev branch +Package can use be used as git repository - but be careful, master is dev branch. ```json "dependencies": { From 852b8ac4dd3b6dea410a57c9605c1b5dba403e2b Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Thu, 19 Nov 2020 15:38:41 +0300 Subject: [PATCH 07/17] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bbf959..e27b95c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.2.0" + "com.consulo.ide": "2.4.0" } } ``` @@ -36,7 +36,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.2.0" + "com.consulo.ide": "2.4.0" } } ``` From 3f76fab51ea561e849129fb0a923daea028863cf Mon Sep 17 00:00:00 2001 From: VISTALL Date: Sat, 27 Feb 2021 02:11:36 +0300 Subject: [PATCH 08/17] use datapath only from main thread --- Editor/Consulo/WebApiServer.cs | 11 +++++++---- README.md | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Editor/Consulo/WebApiServer.cs b/Editor/Consulo/WebApiServer.cs index 229b5dd..623b4f1 100644 --- a/Editor/Consulo/WebApiServer.cs +++ b/Editor/Consulo/WebApiServer.cs @@ -20,7 +20,6 @@ using System.IO; using UnityEditor; using UnityEngine; -using Consulo.Internal.UnityEditor; namespace Consulo.Internal.UnityEditor { @@ -30,6 +29,8 @@ public class WebApiServer public static string ourCurrentTestUUID; public static string ourCurrentTestName; + private static string ourDataPath; + private static MessageSender ourMessageSender; static WebApiServer() @@ -50,6 +51,8 @@ static WebApiServer() UnityUtil.RunInMainThread(() => { + ourDataPath = Application.dataPath; + AppDomain.CurrentDomain.DomainUnload += (sender, e) => { EditorUserBuildSettings.activeBuildTargetChanged -= action; @@ -64,7 +67,7 @@ static WebApiServer() Application.RegisterLogCallback((condition, stackTrace, type) => { // we can't use debug and log handler - if(UnityUtil.IsDebugEnabled()) + if(UnityUtil.IsDebugEnabled() || ourDataPath == null) { return; } @@ -88,7 +91,7 @@ static WebApiServer() jsonClass.Add("condition", cutTooLogMessage(condition)); jsonClass.Add("stackTrace", stackTrace); - jsonClass.Add("projectPath", Path.GetDirectoryName(Application.dataPath)); + jsonClass.Add("projectPath", Path.GetDirectoryName(ourDataPath)); jsonClass.Add("type", Enum.GetName(typeof(LogType), type)); Push("unityLog", jsonClass); @@ -100,7 +103,7 @@ static WebApiServer() JSONClass jsonClass = new JSONClass(); jsonClass.Add("isPlaying", new JSONData(EditorApplication.isPlaying)); - jsonClass.Add("projectPath", Path.GetDirectoryName(Application.dataPath)); + jsonClass.Add("projectPath", Path.GetDirectoryName(ourDataPath)); Push("unityPlayState", jsonClass); }; diff --git a/README.md b/README.md index e27b95c..b7c5f22 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.4.0" + "com.consulo.ide": "2.5.0" } } ``` @@ -36,7 +36,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.4.0" + "com.consulo.ide": "2.5.0" } } ``` diff --git a/package.json b/package.json index 4a82a18..25741c4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.4.0", + "version": "2.5.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", "license": "Apache-2.0" From b25393f154e74a09bc78068fb0a7636976f37a49 Mon Sep 17 00:00:00 2001 From: VISTALL Date: Sat, 27 Feb 2021 02:52:40 +0300 Subject: [PATCH 09/17] disable for batch mode, also fix npe on play mode, sometimes datapath is null --- Editor/Consulo/ConsuloIntegration.cs | 1 + Editor/Consulo/WebApiServer.cs | 22 ++++++++++++++++------ README.md | 4 ++-- package.json | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index dd0369a..aae516e 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -170,6 +170,7 @@ public static void SendToConsulo(string url, JSONClass jsonClass, bool focus = f } catch(Exception e) { + UnityEngine.Debug.LogError(e); EditorUtility.DisplayDialog(PluginConstants.ourDialogTitle, "Consulo is not accessible at http://localhost:" + PluginConstants.ourPort + "/" + url + ", message: " + e.Message, "OK"); } } diff --git a/Editor/Consulo/WebApiServer.cs b/Editor/Consulo/WebApiServer.cs index 623b4f1..a4d8f0b 100644 --- a/Editor/Consulo/WebApiServer.cs +++ b/Editor/Consulo/WebApiServer.cs @@ -29,12 +29,17 @@ public class WebApiServer public static string ourCurrentTestUUID; public static string ourCurrentTestName; - private static string ourDataPath; + private static string ourDataPathForLogging; private static MessageSender ourMessageSender; static WebApiServer() { + if(Application.isBatchMode) + { + return; + } + Process currentProcess = Process.GetCurrentProcess(); int unityConsuloPluginPort = 56000 + currentProcess.Id % 1000 + 2000; // 56000 + 2000 @@ -51,7 +56,7 @@ static WebApiServer() UnityUtil.RunInMainThread(() => { - ourDataPath = Application.dataPath; + ourDataPathForLogging = Application.dataPath; AppDomain.CurrentDomain.DomainUnload += (sender, e) => { @@ -67,7 +72,7 @@ static WebApiServer() Application.RegisterLogCallback((condition, stackTrace, type) => { // we can't use debug and log handler - if(UnityUtil.IsDebugEnabled() || ourDataPath == null) + if(UnityUtil.IsDebugEnabled() || string.IsNullOrEmpty(ourDataPathForLogging)) { return; } @@ -91,19 +96,19 @@ static WebApiServer() jsonClass.Add("condition", cutTooLogMessage(condition)); jsonClass.Add("stackTrace", stackTrace); - jsonClass.Add("projectPath", Path.GetDirectoryName(ourDataPath)); + jsonClass.Add("projectPath", Path.GetDirectoryName(ourDataPathForLogging)); jsonClass.Add("type", Enum.GetName(typeof(LogType), type)); Push("unityLog", jsonClass); } }); - EditorApplication.playmodeStateChanged += delegate + EditorApplication.playmodeStateChanged += () => { JSONClass jsonClass = new JSONClass(); jsonClass.Add("isPlaying", new JSONData(EditorApplication.isPlaying)); - jsonClass.Add("projectPath", Path.GetDirectoryName(ourDataPath)); + jsonClass.Add("projectPath", Path.GetDirectoryName(Application.dataPath)); Push("unityPlayState", jsonClass); }; @@ -121,6 +126,11 @@ private static string cutTooLogMessage(string message) public static void Push(string url, JSONClass message) { + if(Application.isBatchMode) + { + return; + } + ourMessageSender.Push(url, message); } } diff --git a/README.md b/README.md index b7c5f22..6136d68 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.5.0" + "com.consulo.ide": "2.6.0" } } ``` @@ -36,7 +36,7 @@ Need add package to package list in `manifest.json` } ], "dependencies": { - "com.consulo.ide": "2.5.0" + "com.consulo.ide": "2.6.0" } } ``` diff --git a/package.json b/package.json index 25741c4..5cd261c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.5.0", + "version": "2.6.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", "license": "Apache-2.0" From c0a6a7278f6c2b9e6f6a712aab8b4ede7712939e Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Sat, 29 May 2021 16:03:39 +0300 Subject: [PATCH 10/17] Update README.md --- README.md | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 6136d68..94dd968 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,8 @@ Need add package to package list in `manifest.json` ## Before 2019.3 (due certificate problem - use http protocol) ```json { - "scopedRegistries": [ - { - "name": "consulo.io", - "url": "http://upm.consulo.io/", - "scopes": [ - "com.consulo" - ] - } - ], "dependencies": { - "com.consulo.ide": "2.6.0" + "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git#2.6.0" } } ``` @@ -26,17 +17,8 @@ Need add package to package list in `manifest.json` ```json { - "scopedRegistries": [ - { - "name": "consulo.io", - "url": "https://upm.consulo.io/", - "scopes": [ - "com.consulo" - ] - } - ], "dependencies": { - "com.consulo.ide": "2.6.0" + "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git#2.6.0" } } ``` From a5a06f5664e8305383fbf6687b06d4a3508931ce Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Sat, 29 May 2021 16:03:55 +0300 Subject: [PATCH 11/17] Update README.md --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 94dd968..0aa8741 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,6 @@ Need add package to package list in `manifest.json` > Packages/manifest.json -## Before 2019.3 (due certificate problem - use http protocol) -```json -{ - "dependencies": { - "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git#2.6.0" - } -} -``` - -## After 2019.3 - ```json { "dependencies": { From 046f8c6e5a055563039e0e430463a390ee826133 Mon Sep 17 00:00:00 2001 From: VISTALL Date: Sun, 15 Aug 2021 13:58:53 +0300 Subject: [PATCH 12/17] ProcessName can throw exception. split process searching and socket searching try blocks. up ver --- Editor/Consulo/ConsuloIntegration.cs | 28 ++++++++++++++++++++++------ package.json | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index aae516e..29bd992 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -249,32 +249,48 @@ private static bool IsConsuloStarted(bool useTimeCheck = false) Process[] processes = Process.GetProcesses(); foreach (Process process in processes) { - string processName = process.ProcessName.ToLowerInvariant(); - if(processName.Contains("consulo")) + string processName = null; + + try + { + // System.InvalidOperationException: Process has exited or is inaccessible, so the requested information is not available. + processName = process.ProcessName.ToLowerInvariant(); + } + catch + { + } + + if(processName != null && processName.Contains("consulo")) { ourLastCheckedProcessId = process.Id; return ourLastCheckResult = true; } } + } + catch (Exception e) + { + UnityEngine.Debug.LogError(e); + } + try + { if (UnityUtil.IsSocketSearchingEnabled()) { - using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) - { + using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { sock.ReceiveTimeout = 100; sock.SendTimeout = 100; sock.Blocking = true; sock.Connect("localhost", PluginConstants.ourPort); - if(sock.Connected) + if (sock.Connected) { return ourLastCheckResult = true; } } } } - catch(Exception e) + catch { } return false; diff --git a/package.json b/package.json index 5cd261c..3ba6f34 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.6.0", + "version": "2.7.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", "license": "Apache-2.0" From a4373a6d8c64cfd504c4da39f36c672055828848 Mon Sep 17 00:00:00 2001 From: VISTALL Date: Tue, 14 Dec 2021 00:41:29 +0300 Subject: [PATCH 13/17] add using for web request --- Editor/Consulo/ConsuloIntegration.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index 29bd992..12307a9 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -213,17 +213,19 @@ private static System.Collections.IEnumerator SendRequestToConsuloImpl(string ur { string fullUrl = "http://localhost:" + PluginConstants.ourPort + "/api/" + url; - UnityEngine.Networking.UnityWebRequest post = new UnityEngine.Networking.UnityWebRequest(fullUrl, UnityEngine.Networking.UnityWebRequest.kHttpVerbPOST); - byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(jsonClass.ToString()); - post.uploadHandler = new UnityEngine.Networking.UploadHandlerRaw(jsonToSend); - post.SetRequestHeader("Content-Type", "application/json"); - post.timeout = ourTimeout; + using(UnityEngine.Networking.UnityWebRequest post = new UnityEngine.Networking.UnityWebRequest(fullUrl, UnityEngine.Networking.UnityWebRequest.kHttpVerbPOST)) + { + byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(jsonClass.ToString()); + post.uploadHandler = new UnityEngine.Networking.UploadHandlerRaw(jsonToSend); + post.SetRequestHeader("Content-Type", "application/json"); + post.timeout = ourTimeout; - yield return post.SendWebRequest(); + yield return post.SendWebRequest(); - if(post.isHttpError || post.isNetworkError) - { - throw new Exception(post.error); + if (post.isHttpError || post.isNetworkError) + { + throw new Exception(post.error); + } } } From baf8f252100dcac4cfe372a81429e9fb19dc7a03 Mon Sep 17 00:00:00 2001 From: VISTALL Date: Tue, 14 Dec 2021 23:20:24 +0300 Subject: [PATCH 14/17] change to webrequest due we dont need unity webrequest --- Editor/Consulo/ConsuloIntegration.cs | 51 ++++++++++++++-------------- Editor/Consulo/PluginConstants.cs | 2 -- Editor/Consulo/UnityUtil.cs | 2 +- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index 12307a9..88b2095 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -190,43 +190,44 @@ public static void SendToConsulo(string url, JSONClass jsonClass, bool focus = f private static void SendRequestToConsulo(string url, JSONClass jsonClass, bool focus) { - System.Collections.IEnumerator e = SendRequestToConsuloImpl(url, jsonClass); - while(e.MoveNext()) + SendRequestToConsuloImpl(url, jsonClass, () => { - } - - if(focus) - { - switch(UnityUtil.OSFamily) + if (focus) { - case OSFamily.Windows: - if(ourLastCheckedProcessId != -1) - { - User32Dll.AllowSetForegroundWindow(ourLastCheckedProcessId); - } - break; + switch (UnityUtil.OSFamily) { + case OSFamily.Windows: + if (ourLastCheckedProcessId != -1) + { + User32Dll.AllowSetForegroundWindow(ourLastCheckedProcessId); + } + break; + } } - } + }); } - private static System.Collections.IEnumerator SendRequestToConsuloImpl(string url, JSONClass jsonClass) + private static void SendRequestToConsuloImpl(string url, JSONClass jsonClass, Action onComplete) { string fullUrl = "http://localhost:" + PluginConstants.ourPort + "/api/" + url; - using(UnityEngine.Networking.UnityWebRequest post = new UnityEngine.Networking.UnityWebRequest(fullUrl, UnityEngine.Networking.UnityWebRequest.kHttpVerbPOST)) + HttpWebRequest request = (HttpWebRequest) WebRequest.Create(fullUrl); + request.Method = "POST"; + request.ReadWriteTimeout = 15_000; + request.Timeout = 15_000; + request.ContentType = "application/json"; + using (var streamWriter = new StreamWriter(request.GetRequestStream())) { - byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(jsonClass.ToString()); - post.uploadHandler = new UnityEngine.Networking.UploadHandlerRaw(jsonToSend); - post.SetRequestHeader("Content-Type", "application/json"); - post.timeout = ourTimeout; + string json = jsonClass.ToString(); - yield return post.SendWebRequest(); + streamWriter.Write(json); + } - if (post.isHttpError || post.isNetworkError) - { - throw new Exception(post.error); - } + using (HttpWebResponse response = (HttpWebResponse) request.GetResponse()) + { + // not interest } + + onComplete(); } private static bool IsConsuloStarted(bool useTimeCheck = false) diff --git a/Editor/Consulo/PluginConstants.cs b/Editor/Consulo/PluginConstants.cs index 5216c14..5aba7d0 100644 --- a/Editor/Consulo/PluginConstants.cs +++ b/Editor/Consulo/PluginConstants.cs @@ -14,8 +14,6 @@ * limitations under the License. */ -using Consulo.Internal.UnityEditor; - namespace Consulo.Internal.UnityEditor { internal class PluginConstants diff --git a/Editor/Consulo/UnityUtil.cs b/Editor/Consulo/UnityUtil.cs index 48b7c71..3ed5af6 100644 --- a/Editor/Consulo/UnityUtil.cs +++ b/Editor/Consulo/UnityUtil.cs @@ -53,7 +53,7 @@ internal static bool IsDebugEnabled() #if CONSULO_ACTION_DEBUG return true; #else - return false; + return true; #endif } From 4dfcd20e4fa8f9298254e9560ae16ac200d44e1d Mon Sep 17 00:00:00 2001 From: VISTALL Date: Tue, 14 Dec 2021 23:31:02 +0300 Subject: [PATCH 15/17] add retry for bind to #27 --- Editor/Consulo/HTTPServer.cs | 42 +++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/Editor/Consulo/HTTPServer.cs b/Editor/Consulo/HTTPServer.cs index 0a655b6..0cb04b0 100644 --- a/Editor/Consulo/HTTPServer.cs +++ b/Editor/Consulo/HTTPServer.cs @@ -34,7 +34,7 @@ #endif using UnityEditor; using UnityEngine; -using Consulo.Internal.UnityEditor; +using System.Net.Sockets; namespace Consulo.Internal.UnityEditor { @@ -53,12 +53,31 @@ public HTTPServer(int port) public void Stop() { myStopped = true; - myListenThread.Abort(); - myListener.Stop(); + myListenThread?.Abort(); + myListener?.Stop(); } private void Listen() { + int count = 0; + while(IsPortUsed()) + { + if (myStopped) + { + return; + } + + count ++; + + if (count > 10) + { + UnityEngine.Debug.LogError(myPort + " used. Can't bind http api server"); + return; + } + + Thread.Sleep(3000); + } + myListener = new HttpListener(); myListener.Prefixes.Add("http://*:" + myPort + "/"); myListener.Start(); @@ -75,6 +94,23 @@ private void Listen() } } + private bool IsPortUsed() + { + try + { + using (TcpClient ignored = new TcpClient("localhost", myPort)) + { + // jus close it + } + + return true; + } + catch + { + return false; + } + } + private void Process(HttpListenerContext context) { var requestHttpMethod = context.Request.HttpMethod; From 12842b688392691f9a91293207aad2e0bfd6c723 Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Thu, 6 Jul 2023 12:42:48 +0400 Subject: [PATCH 16/17] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0aa8741..1f5aea6 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,6 @@ Package can use be used as git repository - but be careful, master is dev branch "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git" } ``` + +# Links + * [Help](https://consulo.help/plugins/consulo.unity3d/) From 735366edef3d850773274c5fd386359d36526b70 Mon Sep 17 00:00:00 2001 From: Valery Semenchuk Date: Thu, 20 Aug 2026 21:52:19 +0300 Subject: [PATCH 17/17] up version - fix compatibility with unity 6.3 --- Editor/Consulo/ConsuloIntegration.cs | 12 ++++++++++-- README.md | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Editor/Consulo/ConsuloIntegration.cs b/Editor/Consulo/ConsuloIntegration.cs index 88b2095..a71ed21 100644 --- a/Editor/Consulo/ConsuloIntegration.cs +++ b/Editor/Consulo/ConsuloIntegration.cs @@ -96,7 +96,11 @@ internal static bool UseConsulo() } [OnOpenAsset] - static bool OnOpenedAssetCallback(int instanceID, int line) +#if UNITY_6000_3_OR_NEWER + static bool OnOpenedAssetCallback(UnityEngine.EntityId assetId, int line) +#else + static bool OnOpenedAssetCallback(int assetId, int line) +#endif { if(!UseConsulo()) { @@ -107,7 +111,11 @@ static bool OnOpenedAssetCallback(int instanceID, int line) return false; } - UnityEngine.Object selected = EditorUtility.InstanceIDToObject(instanceID); +#if UNITY_6000_3_OR_NEWER + UnityEngine.Object selected = EditorUtility.EntityIdToObject(assetId); +#else + UnityEngine.Object selected = EditorUtility.InstanceIDToObject(assetId); +#endif string contentType = selected.GetType().ToString(); if(!ourSupportedContentTypes.Contains(contentType)) { diff --git a/README.md b/README.md index 1f5aea6..81319da 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Need add package to package list in `manifest.json` ```json { "dependencies": { - "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git#2.6.0" + "com.consulo.ide": "https://github.com/consulo/UnityEditorConsuloPlugin.git#2.9.0" } } ``` diff --git a/package.json b/package.json index 3ba6f34..ac21413 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.consulo.ide", "displayName": "UnityEditor Consulo Plugin", - "version": "2.7.0", + "version": "2.9.0", "description": "Plugin for UnityEditor add some usefull actions for Consulo", "author": "https://consulo.io", "license": "Apache-2.0"