test
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
|
||||
////TODO: survive domain reload properly
|
||||
|
||||
namespace UnityEngine.InputSystem.Editor
|
||||
{
|
||||
internal class InputActionDebuggerWindow : EditorWindow
|
||||
{
|
||||
[NonSerialized] private InputAction m_Action = null;
|
||||
|
||||
public static void CreateOrShowExisting(InputAction action)
|
||||
{
|
||||
if (action == null)
|
||||
throw new System.ArgumentNullException(nameof(action));
|
||||
|
||||
// See if we have an existing window for the action and if so pop it in front.
|
||||
if (s_OpenDebuggerWindows != null)
|
||||
{
|
||||
for (var i = 0; i < s_OpenDebuggerWindows.Count; ++i)
|
||||
{
|
||||
var existingWindow = s_OpenDebuggerWindows[i];
|
||||
if (ReferenceEquals(existingWindow.m_Action, action))
|
||||
{
|
||||
existingWindow.Show();
|
||||
existingWindow.Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No, so create a new one.
|
||||
var window = CreateInstance<InputActionDebuggerWindow>();
|
||||
window.Show();
|
||||
window.titleContent = new GUIContent(action.name);
|
||||
window.AddToList();
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
}
|
||||
|
||||
private static List<InputActionDebuggerWindow> s_OpenDebuggerWindows;
|
||||
|
||||
private void AddToList()
|
||||
{
|
||||
if (s_OpenDebuggerWindows == null)
|
||||
s_OpenDebuggerWindows = new List<InputActionDebuggerWindow>();
|
||||
if (!s_OpenDebuggerWindows.Contains(this))
|
||||
s_OpenDebuggerWindows.Add(this);
|
||||
}
|
||||
|
||||
private void RemoveFromList()
|
||||
{
|
||||
if (s_OpenDebuggerWindows != null)
|
||||
s_OpenDebuggerWindows.Remove(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // UNITY_EDITOR
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d659406a304446c599b9ec454663c46
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c3f24f77c633a444893b75d39ae4fa3c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea7d19a9cdd73486689f292cc9d38018
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user