This commit is contained in:
Hubert Mattusch 2023-06-30 13:41:43 +02:00
parent 34807988d8
commit 17f48f7eb2
5 changed files with 58 additions and 1 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

@ -62,7 +62,13 @@ namespace NEG.UI.UnityUi
{ {
CurrentSelectionSource = SelectionSource.Pointer; CurrentSelectionSource = SelectionSource.Pointer;
Cursor.visible = true; Cursor.visible = true;
if (EventSystem.current == null)
{
SetDirectionInput();
return;
}
if (EventSystem.current.currentInputModule == null) if (EventSystem.current.currentInputModule == null)
return; return;