UI 자동화를 위해 바인딩 기능 구현
- 유니티 에셋 인증 오류로 meta 재생성
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
|
||||
Reference in New Issue
Block a user