From 17f48f7eb282699b64d306a38b6600d16fb73413 Mon Sep 17 00:00:00 2001 From: Hubert Mattusch Date: Fri, 30 Jun 2023 13:41:43 +0200 Subject: [PATCH 1/2] update --- Editor/ScreenshotMaker.cs | 21 +++++++++++++++++++++ Editor/ScreenshotMaker.cs.meta | 3 +++ Editor/TsvImporter.cs | 16 ++++++++++++++++ Editor/TsvImporter.cs.meta | 11 +++++++++++ NEG/UI/UnityUi/MonoUiInputManger.cs | 8 +++++++- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 Editor/ScreenshotMaker.cs create mode 100644 Editor/ScreenshotMaker.cs.meta create mode 100644 Editor/TsvImporter.cs create mode 100644 Editor/TsvImporter.cs.meta diff --git a/Editor/ScreenshotMaker.cs b/Editor/ScreenshotMaker.cs new file mode 100644 index 0000000..7304f1c --- /dev/null +++ b/Editor/ScreenshotMaker.cs @@ -0,0 +1,21 @@ +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace NEG.Editor +{ + public static class ScreenshotMaker + { + [MenuItem("CONTEXT/Camera/Save view")] + public static void Capture(MenuCommand command) + { + string path = EditorUtility.SaveFilePanel("Save screenshot", "", "screen.png", "png"); + if (path.Length == 0) + return; + + ScreenCapture.CaptureScreenshot(path); + + } + + } +} \ No newline at end of file diff --git a/Editor/ScreenshotMaker.cs.meta b/Editor/ScreenshotMaker.cs.meta new file mode 100644 index 0000000..1cf608a --- /dev/null +++ b/Editor/ScreenshotMaker.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7dba407e8e8740a1bed3ee5fa833b13c +timeCreated: 1687881092 \ No newline at end of file diff --git a/Editor/TsvImporter.cs b/Editor/TsvImporter.cs new file mode 100644 index 0000000..77299f5 --- /dev/null +++ b/Editor/TsvImporter.cs @@ -0,0 +1,16 @@ +using System.IO; +using UnityEditor; +using UnityEditor.AssetImporters; +using UnityEditor.Experimental.AssetImporters; +using UnityEngine; + +[ScriptedImporter(1, "tsv")] +public class TsvImporter : ScriptedImporter +{ + public override void OnImportAsset(AssetImportContext ctx) + { + var textAsset = new TextAsset(File.ReadAllText(ctx.assetPath)); + ctx.AddObjectToAsset(Path.GetFileNameWithoutExtension(ctx.assetPath), textAsset); + ctx.SetMainObject(textAsset); + } +} diff --git a/Editor/TsvImporter.cs.meta b/Editor/TsvImporter.cs.meta new file mode 100644 index 0000000..cc19afd --- /dev/null +++ b/Editor/TsvImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3f8438db4084014bab0a063e4675d3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/NEG/UI/UnityUi/MonoUiInputManger.cs b/NEG/UI/UnityUi/MonoUiInputManger.cs index 1285f13..22cd060 100644 --- a/NEG/UI/UnityUi/MonoUiInputManger.cs +++ b/NEG/UI/UnityUi/MonoUiInputManger.cs @@ -62,7 +62,13 @@ namespace NEG.UI.UnityUi { CurrentSelectionSource = SelectionSource.Pointer; Cursor.visible = true; - + + if (EventSystem.current == null) + { + SetDirectionInput(); + return; + } + if (EventSystem.current.currentInputModule == null) return; From 9e60fdf32d4597e938a94c4da77ed71bbfcfd05e Mon Sep 17 00:00:00 2001 From: Hubert Mattusch Date: Mon, 31 Jul 2023 11:05:57 +0200 Subject: [PATCH 2/2] fix popup show --- NEG/UI/UiManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEG/UI/UiManager.cs b/NEG/UI/UiManager.cs index 8e315cc..c0fb864 100644 --- a/NEG/UI/UiManager.cs +++ b/NEG/UI/UiManager.cs @@ -151,7 +151,7 @@ namespace NEG.UI { if (forceShow) { - if(currentShownPopup.priority <= priority) + if(currentShownPopup.data != null && currentShownPopup.priority >= priority) return; popupsToShow.Enqueue(currentShownPopup.data, currentShownPopup.priority); @@ -163,6 +163,8 @@ namespace NEG.UI { if(!d.IsValid) continue; + if(d == currentShownPopup.data) + continue; ShowPopup(d, p); return; }