Merge branch 'better-ui-manager' of newexceptiongames.dynamic-dns.net:NewExceptionGames/Neg_Utils into better-ui-manager

This commit is contained in:
Hubert Mattusch 2023-08-12 11:15:06 +02:00
commit 85daf89041
6 changed files with 61 additions and 2 deletions

21
Editor/ScreenshotMaker.cs Normal file
View File

@ -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);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7dba407e8e8740a1bed3ee5fa833b13c
timeCreated: 1687881092

16
Editor/TsvImporter.cs Normal file
View File

@ -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);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b3f8438db4084014bab0a063e4675d3f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -173,7 +173,7 @@ namespace NEG.UI
{
if (forceShow)
{
if(currentShownPopup.priority <= priority)
if(currentShownPopup.data != null && currentShownPopup.priority >= priority)
return;
popupsToShow.Enqueue(currentShownPopup.data, currentShownPopup.priority);
@ -185,6 +185,8 @@ namespace NEG.UI
{
if(!d.IsValid)
continue;
if(d == currentShownPopup.data)
continue;
ShowPopup(d, p);
return;
}

View File

@ -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;