add
1.新增手柄相关适配 2.新增设备重映射绑定 3.新增设备映射图标更新
This commit is contained in:
parent
a472318e55
commit
5862fb2af1
File diff suppressed because it is too large
Load Diff
@ -1,47 +0,0 @@
|
||||
// using UnityEngine;
|
||||
// using UnityEngine.UI;
|
||||
// using UnityEngine.InputSystem;
|
||||
// using InputGlyphsFramework;
|
||||
// using DeviceType = InputGlyphsFramework.DeviceType;
|
||||
//
|
||||
// [RequireComponent(typeof(RectTransform))]
|
||||
// public class ActionPromptImage : MonoBehaviour
|
||||
// {
|
||||
// public InputActionReference actionReference;
|
||||
// public int bindingIndex = 0;
|
||||
// public Image targetImage;
|
||||
// public bool hideIfMissing = true;
|
||||
// Sprite lastSprite;
|
||||
//
|
||||
// void OnEnable()
|
||||
// {
|
||||
// if (targetImage == null) targetImage = GetComponentInChildren<Image>();
|
||||
// if (InputService.Instance != null) InputService.Instance.OnBindingChanged += OnBindingChanged;
|
||||
// InputDeviceWatcher.OnDeviceChanged += OnDeviceChanged;
|
||||
// UpdatePrompt();
|
||||
// }
|
||||
// void OnDisable()
|
||||
// {
|
||||
// if (InputService.Instance != null) InputService.Instance.OnBindingChanged -= OnBindingChanged;
|
||||
// InputDeviceWatcher.OnDeviceChanged -= OnDeviceChanged;
|
||||
// }
|
||||
// void OnBindingChanged(UnityEngine.InputSystem.InputAction action, int idx) { if (actionReference != null && actionReference.action == action) UpdatePrompt(); }
|
||||
// void OnDeviceChanged(InputDeviceWatcher.InputDeviceCategory cat) { UpdatePrompt(); }
|
||||
//
|
||||
// void UpdatePrompt()
|
||||
// {
|
||||
// if (actionReference == null || actionReference.action == null || targetImage == null) return;
|
||||
// var action = actionReference.action;
|
||||
// int best = BindingGlyphHelper.FindBestBindingIndexForDevice(action);
|
||||
// if (best >= 0) bindingIndex = best;
|
||||
// string path = InputService.GetBindingControlPath(action, bindingIndex);
|
||||
// var device = MapDevice(InputDeviceWatcher.CurrentCategory);
|
||||
// if (GlyphService.Instance != null && GlyphService.Instance.TryGetUISpriteForActionPath(path, device, out Sprite s))
|
||||
// {
|
||||
// if (lastSprite != s) { targetImage.sprite = s; targetImage.enabled = true; lastSprite = s; }
|
||||
// return;
|
||||
// }
|
||||
// lastSprite = null; if (hideIfMissing) targetImage.enabled = false; else targetImage.sprite = null;
|
||||
// }
|
||||
// static DeviceType MapDevice(InputDeviceWatcher.InputDeviceCategory cat) { switch (cat) { case InputDeviceWatcher.InputDeviceCategory.Xbox: return DeviceType.Xbox; case InputDeviceWatcher.InputDeviceCategory.PlayStation: return DeviceType.PlayStation; case InputDeviceWatcher.InputDeviceCategory.Other: return DeviceType.Other; default: return DeviceType.Keyboard; } }
|
||||
// }
|
||||
@ -1,77 +0,0 @@
|
||||
using InputGlyphsFramework;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
[RequireComponent(typeof(RectTransform))]
|
||||
public class ActionPromptTMP : MonoBehaviour
|
||||
{
|
||||
public InputActionReference actionReference;
|
||||
public TMP_Text textField;
|
||||
public string template = "({0})";
|
||||
string lastRendered;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (textField == null) textField = GetComponentInChildren<TMP_Text>();
|
||||
if (InputService.Instance != null) InputService.Instance.OnBindingChanged += OnBindingChanged;
|
||||
InputDeviceWatcher.OnDeviceChanged += OnDeviceChanged;
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (InputService.Instance != null) InputService.Instance.OnBindingChanged -= OnBindingChanged;
|
||||
InputDeviceWatcher.OnDeviceChanged -= OnDeviceChanged;
|
||||
}
|
||||
|
||||
void OnBindingChanged(InputAction action, int idx)
|
||||
{
|
||||
if (actionReference == null || actionReference.action == null) return;
|
||||
if (action == actionReference.action) UpdatePrompt();
|
||||
}
|
||||
|
||||
void OnDeviceChanged(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
|
||||
void UpdatePrompt()
|
||||
{
|
||||
if (actionReference == null || actionReference.action == null || textField == null) return;
|
||||
var action = actionReference.action;
|
||||
|
||||
string path = InputService.GetBindingControlPath(action);
|
||||
var device = InputDeviceWatcher.CurrentCategory;
|
||||
string displayFallback = string.Empty;
|
||||
if (GlyphService.Instance != null && GlyphService.Instance.TryGetTMPTagForActionPath(path, device, out string tag, out displayFallback))
|
||||
{
|
||||
var s = string.Format(template, tag);
|
||||
if (s != lastRendered)
|
||||
{
|
||||
textField.text = s;
|
||||
lastRendered = s;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var display = InputService.GetBindingDisplay(action);
|
||||
|
||||
var fallback = string.Format(template, string.IsNullOrEmpty(display) ? (displayFallback ?? GetDisplayFromPath(path)) : display);
|
||||
if (fallback != lastRendered)
|
||||
{
|
||||
textField.text = fallback;
|
||||
lastRendered = fallback;
|
||||
}
|
||||
}
|
||||
|
||||
string GetDisplayFromPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path)) return string.Empty;
|
||||
var parts = path.Split('/');
|
||||
var last = parts[parts.Length - 1].Trim(new char[] { '{', '}', '<', '>', '\'', '"' });
|
||||
return last;
|
||||
}
|
||||
}
|
||||
@ -1,31 +1,108 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using AlicizaX.InputGlyph;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using InputGlyphsFramework;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class GlyphService : MonoBehaviour
|
||||
public static class GlyphService
|
||||
{
|
||||
public static GlyphService Instance { get; private set; }
|
||||
public InputGlyphDatabase database;
|
||||
/// <summary>
|
||||
/// 可选的全局数据库引用。你可以通过场景内的启动组件在 Awake 时赋值,
|
||||
/// 或者在调用每个方法时传入 InputGlyphDatabase 参数(见方法签名)。
|
||||
/// </summary>
|
||||
public static InputGlyphDatabase Database { get; set; }
|
||||
|
||||
void Awake()
|
||||
public static string GetBindingDisplay(InputAction action, InputGlyphDatabase db = null)
|
||||
{
|
||||
if (Instance != null && Instance != this) { Destroy(this); return; }
|
||||
Instance = this;
|
||||
if (action == null) return string.Empty;
|
||||
var control = GetBindingControl(action);
|
||||
return control != null ? control.displayName : string.Empty;
|
||||
}
|
||||
|
||||
public bool TryGetTMPTagForActionPath(string controlPath, InputDeviceWatcher.InputDeviceCategory device, out string tag, out string displayFallback)
|
||||
public static string GetBindingControlPath(InputAction action, InputDeviceWatcher.InputDeviceCategory? deviceOverride = null, InputGlyphDatabase db = null)
|
||||
{
|
||||
if (action == null) return string.Empty;
|
||||
var control = GetBindingControl(action, deviceOverride);
|
||||
return control != null ? $"{(control.device?.displayName ?? "Unknown")}/{control.displayName}" : string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前设备类别(或传入的 deviceOverride)尝试在 action.controls 中找到匹配的 control。
|
||||
/// 匹配策略:检查 control.device.displayName 是否包含类别提示词(忽略大小写)。
|
||||
/// 如果没有匹配项则返回第一个 control(作为最后的退路),或 null。
|
||||
/// </summary>
|
||||
public static InputControl GetBindingControl(InputAction action, InputDeviceWatcher.InputDeviceCategory? deviceOverride = null)
|
||||
{
|
||||
if (action == null) return null;
|
||||
|
||||
var curCategory = deviceOverride ?? InputDeviceWatcher.CurrentCategory;
|
||||
var hints = GetDeviceHintsForCategory(curCategory);
|
||||
|
||||
// 首先找匹配 hints 的 control
|
||||
foreach (var control in action.controls)
|
||||
{
|
||||
var deviceName = control.device?.displayName ?? string.Empty;
|
||||
if (hints.Any(h => deviceName.IndexOf(h, StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
{
|
||||
return control;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有匹配,尝试返回第一个 gamepad/keyboard 优先的 control(更健壮)
|
||||
if (action.controls.Count > 0)
|
||||
{
|
||||
// 优先返回 keyboard/mouse 类型(如果当前类别是 keyboard)
|
||||
if (curCategory == InputDeviceWatcher.InputDeviceCategory.Keyboard)
|
||||
{
|
||||
var k = action.controls.FirstOrDefault(c => (c.device?.displayName ?? "").IndexOf("Keyboard", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
?? action.controls.First();
|
||||
return k;
|
||||
}
|
||||
|
||||
return action.controls.First();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static string[] GetDeviceHintsForCategory(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
switch (cat)
|
||||
{
|
||||
case InputDeviceWatcher.InputDeviceCategory.Keyboard:
|
||||
return new[] { "Keyboard", "Mouse" };
|
||||
case InputDeviceWatcher.InputDeviceCategory.Xbox:
|
||||
return new[] { "XInput", "Xbox", "Gamepad" };
|
||||
case InputDeviceWatcher.InputDeviceCategory.PlayStation:
|
||||
return new[] { "DualShock", "DualSense", "PlayStation", "Gamepad" };
|
||||
default:
|
||||
return new[] { "Gamepad", "Joystick", "Keyboard", "Mouse" };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试根据 controlPath 和设备获取 TMP sprite 标签;如果失败会返回 displayFallback(可直接显示的文字)。
|
||||
/// 逻辑:
|
||||
/// 1) 使用传入 db 或静态 Database;
|
||||
/// 2) 先在指定设备表中查找 entry,找不到则回退到 Keyboard 表;
|
||||
/// 3) 如果 table 或 tmpAsset 缺失 或 entry.Sprite 缺失,则用 displayFallback(从 controlPath 提取最后段或控制名)。
|
||||
/// </summary>
|
||||
public static bool TryGetTMPTagForActionPath(string controlPath, InputDeviceWatcher.InputDeviceCategory device, out string tag, out string displayFallback, InputGlyphDatabase db = null)
|
||||
{
|
||||
tag = null;
|
||||
displayFallback = null;
|
||||
if (string.IsNullOrEmpty(controlPath) || database == null) return false;
|
||||
db = db ?? Database;
|
||||
if (string.IsNullOrEmpty(controlPath) || db == null)
|
||||
{
|
||||
displayFallback = GetDisplayNameFromControlPath(controlPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 优先查当前设备表
|
||||
var entry = database.FindEntryByControlPath(controlPath, device);
|
||||
var entry = db.FindEntryByControlPath(controlPath, device);
|
||||
if (entry == null)
|
||||
{
|
||||
// 回退到 keyboard 表
|
||||
entry = database.FindEntryByControlPath(controlPath, InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
// 设备缺失或没有 entry -> 回退 keyboard
|
||||
entry = db.FindEntryByControlPath(controlPath, InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
}
|
||||
|
||||
if (entry == null)
|
||||
@ -34,8 +111,8 @@ public class GlyphService : MonoBehaviour
|
||||
return false;
|
||||
}
|
||||
|
||||
// 需要一个对应的 TMP Sprite Asset 来生成 <sprite> 标签 —— 查找 entry 所在的表(优先当前设备,再 keyboard)
|
||||
DeviceGlyphTable table = database.GetTable(device) ?? database.GetTable(InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
// 查找对应表(优先目标设备,再 keyboard)
|
||||
var table = db.GetTable(device) ?? db.GetTable(InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
if (table == null || table.tmpAsset == null)
|
||||
{
|
||||
displayFallback = GetDisplayNameFromControlPath(controlPath);
|
||||
@ -54,16 +131,13 @@ public class GlyphService : MonoBehaviour
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryGetUISpriteForActionPath(string controlPath, InputDeviceWatcher.InputDeviceCategory device, out Sprite sprite)
|
||||
public static bool TryGetUISpriteForActionPath(string controlPath, InputDeviceWatcher.InputDeviceCategory device, out Sprite sprite, InputGlyphDatabase db = null)
|
||||
{
|
||||
sprite = null;
|
||||
if (string.IsNullOrEmpty(controlPath) || database == null) return false;
|
||||
db = db ?? Database;
|
||||
if (string.IsNullOrEmpty(controlPath) || db == null) return false;
|
||||
|
||||
var entry = database.FindEntryByControlPath(controlPath, device);
|
||||
if (entry == null)
|
||||
{
|
||||
entry = database.FindEntryByControlPath(controlPath, InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
}
|
||||
var entry = db.FindEntryByControlPath(controlPath, device) ?? db.FindEntryByControlPath(controlPath, InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
if (entry == null) return false;
|
||||
if (entry.Sprite == null) return false;
|
||||
|
||||
@ -71,7 +145,7 @@ public class GlyphService : MonoBehaviour
|
||||
return true;
|
||||
}
|
||||
|
||||
string GetDisplayNameFromControlPath(string controlPath)
|
||||
static string GetDisplayNameFromControlPath(string controlPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(controlPath)) return string.Empty;
|
||||
var parts = controlPath.Split('/');
|
||||
@ -79,4 +153,3 @@ public class GlyphService : MonoBehaviour
|
||||
return last;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
501
Client/Assets/InputGlyph/InputBindingManager.cs
Normal file
501
Client/Assets/InputGlyph/InputBindingManager.cs
Normal file
@ -0,0 +1,501 @@
|
||||
// InputBindingManager.cs
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using System.Reactive.Subjects;
|
||||
using RxUnit = System.Reactive.Unit;
|
||||
|
||||
namespace InputRemapper
|
||||
{
|
||||
public class InputBindingManager : MonoBehaviour
|
||||
{
|
||||
public const string NULL_BINDING = "__NULL__";
|
||||
|
||||
[Tooltip("InputActionAsset to manage")]
|
||||
public InputActionAsset actions;
|
||||
public string fileName = "input_bindings.json";
|
||||
public bool debugMode = false;
|
||||
|
||||
public Dictionary<string, ActionMap> actionMap = new Dictionary<string, ActionMap>();
|
||||
public List<RebindContext> preparedRebinds = new List<RebindContext>();
|
||||
|
||||
internal InputActionRebindingExtensions.RebindingOperation rebindOperation;
|
||||
private readonly List<string> pressedActions = new List<string>();
|
||||
private bool isApplyPending = false;
|
||||
private string defaultBindingsJson = string.Empty;
|
||||
|
||||
public ReplaySubject<RxUnit> OnInputsInit = new ReplaySubject<RxUnit>(1);
|
||||
public Subject<bool> OnApply = new Subject<bool>();
|
||||
public Subject<RebindContext> OnRebindPrepare = new Subject<RebindContext>();
|
||||
public Subject<RxUnit> OnRebindStart = new Subject<RxUnit>();
|
||||
public Subject<bool> OnRebindEnd = new Subject<bool>();
|
||||
public Subject<(RebindContext prepared, RebindContext conflict)> OnRebindConflict = new Subject<(RebindContext, RebindContext)>();
|
||||
|
||||
public string SavePath
|
||||
{
|
||||
get
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
string folder = Application.dataPath;
|
||||
#else
|
||||
string folder = Application.persistentDataPath;
|
||||
#endif
|
||||
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
|
||||
return Path.Combine(folder, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (actions == null)
|
||||
{
|
||||
Debug.LogError("InputBindingManager: InputActionAsset not assigned.");
|
||||
return;
|
||||
}
|
||||
|
||||
BuildActionMap();
|
||||
|
||||
try { defaultBindingsJson = actions.SaveBindingOverridesAsJson(); } catch { defaultBindingsJson = string.Empty; }
|
||||
|
||||
if (File.Exists(SavePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = File.ReadAllText(SavePath);
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
{
|
||||
actions.LoadBindingOverridesFromJson(json);
|
||||
RefreshBindingPathsFromActions();
|
||||
if (debugMode) Debug.Log($"Loaded overrides from {SavePath}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { Debug.LogError("Failed to load overrides: " + ex); }
|
||||
}
|
||||
|
||||
OnInputsInit.OnNext(RxUnit.Default);
|
||||
actions.Enable();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
rebindOperation?.Dispose();
|
||||
rebindOperation = null;
|
||||
|
||||
OnInputsInit?.OnCompleted();
|
||||
OnApply?.OnCompleted();
|
||||
OnRebindPrepare?.OnCompleted();
|
||||
OnRebindStart?.OnCompleted();
|
||||
OnRebindEnd?.OnCompleted();
|
||||
OnRebindConflict?.OnCompleted();
|
||||
}
|
||||
|
||||
private void BuildActionMap()
|
||||
{
|
||||
actionMap.Clear();
|
||||
foreach (var map in actions.actionMaps)
|
||||
actionMap.Add(map.name, new ActionMap(map));
|
||||
}
|
||||
|
||||
private void RefreshBindingPathsFromActions()
|
||||
{
|
||||
foreach (var mapPair in actionMap)
|
||||
{
|
||||
foreach (var actionPair in mapPair.Value.actions)
|
||||
{
|
||||
var a = actionPair.Value;
|
||||
foreach (var bpair in a.bindings)
|
||||
{
|
||||
bpair.Value.bindingPath.EffectivePath = a.action.bindings[bpair.Key].effectivePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ActionMap
|
||||
{
|
||||
public string name;
|
||||
public Dictionary<string, Action> actions = new Dictionary<string, Action>();
|
||||
|
||||
public ActionMap(InputActionMap map)
|
||||
{
|
||||
name = map.name;
|
||||
foreach (var action in map.actions) actions.Add(action.name, new Action(action));
|
||||
}
|
||||
|
||||
public class Action
|
||||
{
|
||||
public InputAction action;
|
||||
public Dictionary<int, Binding> bindings = new Dictionary<int, Binding>();
|
||||
|
||||
public Action(InputAction action)
|
||||
{
|
||||
this.action = action;
|
||||
int count = action.bindings.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (action.bindings[i].isComposite)
|
||||
{
|
||||
int first = i + 1;
|
||||
int last = first;
|
||||
while (last < count && action.bindings[last].isPartOfComposite) last++;
|
||||
for (int p = first; p < last; p++)
|
||||
AddBinding(action.bindings[p], p);
|
||||
i = last - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBinding(action.bindings[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
void AddBinding(InputBinding binding, int bindingIndex)
|
||||
{
|
||||
bindings.Add(bindingIndex, new Binding
|
||||
{
|
||||
name = binding.name,
|
||||
parentAction = action.name,
|
||||
compositePart = binding.name,
|
||||
bindingIndex = bindingIndex,
|
||||
group = binding.groups?.Split(InputBinding.Separator) ?? Array.Empty<string>(),
|
||||
bindingPath = new BindingPath(binding.path, binding.overridePath),
|
||||
inputBinding = binding
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public struct Binding
|
||||
{
|
||||
public string name;
|
||||
public string parentAction;
|
||||
public string compositePart;
|
||||
public int bindingIndex;
|
||||
public string[] group;
|
||||
public BindingPath bindingPath;
|
||||
public InputBinding inputBinding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Simple BindingPath (no glyph caching)
|
||||
public sealed class BindingPath
|
||||
{
|
||||
public string bindingPath;
|
||||
public string overridePath;
|
||||
private readonly Subject<RxUnit> observer = new Subject<RxUnit>();
|
||||
|
||||
public BindingPath(string bindingPath, string overridePath)
|
||||
{
|
||||
this.bindingPath = bindingPath;
|
||||
this.overridePath = overridePath;
|
||||
}
|
||||
|
||||
public string EffectivePath
|
||||
{
|
||||
get => !string.IsNullOrEmpty(overridePath) ? overridePath : bindingPath;
|
||||
set
|
||||
{
|
||||
overridePath = (value == bindingPath) ? string.Empty : value;
|
||||
observer.OnNext(RxUnit.Default);
|
||||
}
|
||||
}
|
||||
|
||||
public IObservable<string> EffectivePathObservable => observer.Select(_ => EffectivePath);
|
||||
}
|
||||
|
||||
public class RebindContext
|
||||
{
|
||||
public InputAction action;
|
||||
public int bindingIndex;
|
||||
public string overridePath;
|
||||
|
||||
public RebindContext(InputAction action, int bindingIndex, string overridePath)
|
||||
{
|
||||
this.action = action; this.bindingIndex = bindingIndex; this.overridePath = overridePath;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is not RebindContext other) return false;
|
||||
if (action == null || other.action == null) return false;
|
||||
return action.name == other.action.name && bindingIndex == other.bindingIndex;
|
||||
}
|
||||
|
||||
public override int GetHashCode() => (action?.name ?? string.Empty, bindingIndex).GetHashCode();
|
||||
public override string ToString() => $"{action?.name ?? "<null>"}:{bindingIndex}";
|
||||
}
|
||||
|
||||
/* ---------------- Public API ---------------- */
|
||||
|
||||
public static InputAction Action(string actionName)
|
||||
{
|
||||
foreach (var map in Instance.actionMap)
|
||||
{
|
||||
if (map.Value.actions.TryGetValue(actionName, out var a)) return a.action;
|
||||
}
|
||||
Debug.LogError($"[InputBindingManager] Could not find action '{actionName}'");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void StartRebind(string actionName, string compositePartName = null)
|
||||
{
|
||||
var action = Action(actionName);
|
||||
if (action == null) return;
|
||||
|
||||
// decide bindingIndex & deviceMatch automatically
|
||||
int bindingIndex = Instance.FindBestBindingIndexForKeyboard(action, compositePartName);
|
||||
if (bindingIndex < 0)
|
||||
{
|
||||
Debug.LogError($"[InputBindingManager] No suitable binding found for action '{actionName}' (part={compositePartName ?? "<null>"})");
|
||||
return;
|
||||
}
|
||||
|
||||
Instance.actions.Disable();
|
||||
Instance.PerformInteractiveRebinding(action, bindingIndex, "<Keyboard>", true);
|
||||
Instance.OnRebindStart.OnNext(RxUnit.Default);
|
||||
if (Instance.debugMode) Debug.Log("[InputBindingManager] Rebind started");
|
||||
}
|
||||
|
||||
public static void CancelRebind() => Instance.rebindOperation?.Cancel();
|
||||
|
||||
public static async Task<bool> ConfirmApply(bool clearConflicts = true)
|
||||
{
|
||||
if (!Instance.isApplyPending) return false;
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var ctx in Instance.preparedRebinds)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ctx.overridePath)) { }
|
||||
else if (ctx.overridePath == NULL_BINDING) ctx.action.RemoveBindingOverride(ctx.bindingIndex);
|
||||
else ctx.action.ApplyBindingOverride(ctx.bindingIndex, ctx.overridePath);
|
||||
|
||||
var bp = GetBindingPath(ctx.action.name, ctx.bindingIndex);
|
||||
if (bp != null) bp.EffectivePath = (ctx.overridePath == NULL_BINDING) ? string.Empty : ctx.overridePath;
|
||||
}
|
||||
|
||||
Instance.preparedRebinds.Clear();
|
||||
await Instance.WriteOverridesToDiskAsync();
|
||||
Instance.OnApply.OnNext(true);
|
||||
Instance.isApplyPending = false;
|
||||
if (Instance.debugMode) Debug.Log("[InputBindingManager] Apply confirmed and saved.");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError("[InputBindingManager] Failed to apply binds: " + ex);
|
||||
Instance.OnApply.OnNext(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DiscardPrepared()
|
||||
{
|
||||
if (!Instance.isApplyPending) return;
|
||||
Instance.preparedRebinds.Clear();
|
||||
Instance.isApplyPending = false;
|
||||
Instance.OnApply.OnNext(false);
|
||||
if (Instance.debugMode) Debug.Log("[InputBindingManager] Prepared rebinds discarded.");
|
||||
}
|
||||
|
||||
private void PerformInteractiveRebinding(InputAction action, int bindingIndex, string deviceMatchPath = null, bool excludeMouseMovementAndScroll = true)
|
||||
{
|
||||
var op = action.PerformInteractiveRebinding(bindingIndex);
|
||||
|
||||
if (!string.IsNullOrEmpty(deviceMatchPath)) op = op.WithControlsHavingToMatchPath(deviceMatchPath);
|
||||
if (excludeMouseMovementAndScroll)
|
||||
{
|
||||
op = op.WithControlsExcluding("<Mouse>/delta");
|
||||
op = op.WithControlsExcluding("<Mouse>/scroll");
|
||||
op = op.WithControlsExcluding("<Mouse>/scroll/x");
|
||||
op = op.WithControlsExcluding("<Mouse>/scroll/y");
|
||||
}
|
||||
|
||||
rebindOperation = op
|
||||
.OnApplyBinding((o, path) =>
|
||||
{
|
||||
if (AnyPreparedRebind(path, action, bindingIndex, out var existing))
|
||||
{
|
||||
PrepareRebind(new RebindContext(action, bindingIndex, path));
|
||||
PrepareRebind(new RebindContext(existing.action, existing.bindingIndex, NULL_BINDING));
|
||||
OnRebindConflict.OnNext((new RebindContext(action, bindingIndex, path), existing));
|
||||
}
|
||||
else if (AnyBindingPath(path, action, bindingIndex, out var dup))
|
||||
{
|
||||
PrepareRebind(new RebindContext(action, bindingIndex, path));
|
||||
PrepareRebind(new RebindContext(dup.action, dup.bindingIndex, NULL_BINDING));
|
||||
OnRebindConflict.OnNext((new RebindContext(action, bindingIndex, path), new RebindContext(dup.action, dup.bindingIndex, dup.action.bindings[dup.bindingIndex].path)));
|
||||
}
|
||||
else
|
||||
{
|
||||
PrepareRebind(new RebindContext(action, bindingIndex, path));
|
||||
}
|
||||
})
|
||||
.OnComplete(opc =>
|
||||
{
|
||||
if (debugMode) Debug.Log("[InputBindingManager] Rebind completed");
|
||||
actions.Enable();
|
||||
OnRebindEnd.OnNext(true);
|
||||
CleanRebindOperation();
|
||||
})
|
||||
.OnCancel(opc =>
|
||||
{
|
||||
if (debugMode) Debug.Log("[InputBindingManager] Rebind cancelled");
|
||||
actions.Enable();
|
||||
OnRebindEnd.OnNext(false);
|
||||
CleanRebindOperation();
|
||||
})
|
||||
.WithCancelingThrough("<Keyboard>/escape")
|
||||
.Start();
|
||||
}
|
||||
|
||||
private void CleanRebindOperation()
|
||||
{
|
||||
rebindOperation?.Dispose();
|
||||
rebindOperation = null;
|
||||
}
|
||||
|
||||
private bool AnyPreparedRebind(string bindingPath, InputAction currentAction, int currentIndex, out RebindContext duplicate)
|
||||
{
|
||||
foreach (var ctx in preparedRebinds)
|
||||
{
|
||||
if (ctx.overridePath == bindingPath && (ctx.action != currentAction || (ctx.action == currentAction && ctx.bindingIndex != currentIndex)))
|
||||
{
|
||||
duplicate = ctx; return true;
|
||||
}
|
||||
}
|
||||
duplicate = null; return false;
|
||||
}
|
||||
|
||||
private bool AnyBindingPath(string bindingPath, InputAction currentAction, int currentIndex, out (InputAction action, int bindingIndex) duplicate)
|
||||
{
|
||||
foreach (var map in actionMap)
|
||||
{
|
||||
foreach (var actionPair in map.Value.actions)
|
||||
{
|
||||
foreach (var bindingPair in actionPair.Value.bindings)
|
||||
{
|
||||
if (actionPair.Value.action == currentAction && bindingPair.Key == currentIndex) continue;
|
||||
var eff = bindingPair.Value.bindingPath.EffectivePath;
|
||||
if (eff == bindingPath)
|
||||
{
|
||||
duplicate = (actionPair.Value.action, bindingPair.Key);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
duplicate = default; return false;
|
||||
}
|
||||
|
||||
private void PrepareRebind(RebindContext context)
|
||||
{
|
||||
preparedRebinds.RemoveAll(x => x.Equals(context));
|
||||
|
||||
if (string.IsNullOrEmpty(context.overridePath))
|
||||
{
|
||||
var bp = GetBindingPath(context.action.name, context.bindingIndex);
|
||||
if (bp != null) context.overridePath = bp.bindingPath;
|
||||
}
|
||||
|
||||
var bindingPath = GetBindingPath(context.action.name, context.bindingIndex);
|
||||
if (bindingPath == null) return;
|
||||
|
||||
if (bindingPath.EffectivePath != context.overridePath)
|
||||
{
|
||||
preparedRebinds.Add(context);
|
||||
isApplyPending = true;
|
||||
OnRebindPrepare.OnNext(context);
|
||||
if (debugMode) Debug.Log($"Prepared rebind: {context} -> {context.overridePath}");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task WriteOverridesToDiskAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = actions.SaveBindingOverridesAsJson();
|
||||
var dir = Path.GetDirectoryName(SavePath);
|
||||
if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
|
||||
using (var sw = new StreamWriter(SavePath, false)) await sw.WriteAsync(json);
|
||||
if (debugMode) Debug.Log($"Overrides saved to {SavePath}");
|
||||
}
|
||||
catch (Exception ex) { Debug.LogError("Failed to save overrides: " + ex); throw; }
|
||||
}
|
||||
|
||||
public async Task ResetToDefaultAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(defaultBindingsJson)) actions.LoadBindingOverridesFromJson(defaultBindingsJson);
|
||||
else
|
||||
{
|
||||
foreach (var map in actionMap)
|
||||
foreach (var a in map.Value.actions)
|
||||
for (int b = 0; b < a.Value.action.bindings.Count; b++)
|
||||
a.Value.action.RemoveBindingOverride(b);
|
||||
}
|
||||
|
||||
RefreshBindingPathsFromActions();
|
||||
await WriteOverridesToDiskAsync();
|
||||
if (debugMode) Debug.Log("Reset to default and saved.");
|
||||
}
|
||||
catch (Exception ex) { Debug.LogError("Failed to reset defaults: " + ex); }
|
||||
}
|
||||
|
||||
public static BindingPath GetBindingPath(string actionName, int bindingIndex = 0)
|
||||
{
|
||||
foreach (var map in Instance.actionMap)
|
||||
{
|
||||
if (map.Value.actions.TryGetValue(actionName, out var action))
|
||||
{
|
||||
if (action.bindings.TryGetValue(bindingIndex, out var binding)) return binding.bindingPath;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// choose best binding index for keyboard; if compositePartName != null then look for part
|
||||
public int FindBestBindingIndexForKeyboard(InputAction action, string compositePartName = null)
|
||||
{
|
||||
if (action == null) return -1;
|
||||
|
||||
int fallbackPart = -1;
|
||||
int fallbackNonComposite = -1;
|
||||
|
||||
for (int i = 0; i < action.bindings.Count; i++)
|
||||
{
|
||||
var b = action.bindings[i];
|
||||
|
||||
if (!string.IsNullOrEmpty(compositePartName))
|
||||
{
|
||||
if (!b.isPartOfComposite) continue;
|
||||
if (!string.Equals(b.name, compositePartName, StringComparison.OrdinalIgnoreCase)) continue;
|
||||
}
|
||||
|
||||
if (b.isPartOfComposite)
|
||||
{
|
||||
if (fallbackPart == -1) fallbackPart = i;
|
||||
if (!string.IsNullOrEmpty(b.path) && b.path.StartsWith("<Keyboard>", StringComparison.OrdinalIgnoreCase)) return i;
|
||||
if (!string.IsNullOrEmpty(b.effectivePath) && b.effectivePath.StartsWith("<Keyboard>", StringComparison.OrdinalIgnoreCase)) return i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fallbackNonComposite == -1) fallbackNonComposite = i;
|
||||
if (!string.IsNullOrEmpty(b.path) && b.path.StartsWith("<Keyboard>", StringComparison.OrdinalIgnoreCase)) return i;
|
||||
if (!string.IsNullOrEmpty(b.effectivePath) && b.effectivePath.StartsWith("<Keyboard>", StringComparison.OrdinalIgnoreCase)) return i;
|
||||
}
|
||||
}
|
||||
|
||||
if (fallbackNonComposite >= 0) return fallbackNonComposite;
|
||||
return fallbackPart;
|
||||
}
|
||||
|
||||
public static InputBindingManager Instance => _instance ??= FindObjectOfType<InputBindingManager>();
|
||||
private static InputBindingManager _instance;
|
||||
}
|
||||
}
|
||||
3
Client/Assets/InputGlyph/InputBindingManager.cs.meta
Normal file
3
Client/Assets/InputGlyph/InputBindingManager.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c25ae9d04ef4e03a723135aa298de16
|
||||
timeCreated: 1765271070
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,13 +4,12 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace InputGlyphsFramework
|
||||
namespace AlicizaX.InputGlyph
|
||||
{
|
||||
[Serializable]
|
||||
public class GlyphEntry
|
||||
{
|
||||
public Sprite Sprite;
|
||||
public string controlPath;
|
||||
public InputAction action;
|
||||
}
|
||||
|
||||
@ -30,7 +29,9 @@ namespace InputGlyphsFramework
|
||||
public DeviceGlyphTable GetTable(InputDeviceWatcher.InputDeviceCategory device)
|
||||
{
|
||||
if (tables == null) return null;
|
||||
for (int i = 0; i < tables.Count; ++i) if (tables[i].deviceType == device) return tables[i];
|
||||
for (int i = 0; i < tables.Count; ++i)
|
||||
if (tables[i].deviceType == device)
|
||||
return tables[i];
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -43,42 +44,13 @@ namespace InputGlyphsFramework
|
||||
for (int i = 0; i < t.entries.Count; ++i)
|
||||
{
|
||||
var e = t.entries[i];
|
||||
if (e != null && !string.IsNullOrEmpty(e.controlPath) && string.Equals(e.controlPath, controlPath, StringComparison.OrdinalIgnoreCase)) return e;
|
||||
if (e.action.controls.Count <= 0) continue;
|
||||
|
||||
var matchPath = $"{e.action.controls[0].device.displayName}/{e.action.controls[0].displayName}";
|
||||
if (string.Equals(matchPath, controlPath, StringComparison.OrdinalIgnoreCase)) return e;
|
||||
}
|
||||
}
|
||||
var kb = GetTable(InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
if (kb != null)
|
||||
{
|
||||
for (int i = 0; i < kb.entries.Count; ++i)
|
||||
{
|
||||
var e = kb.entries[i];
|
||||
if (e != null && !string.IsNullOrEmpty(e.controlPath) && string.Equals(e.controlPath, controlPath, StringComparison.OrdinalIgnoreCase)) return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public GlyphEntry FindEntryBySpriteName(string spriteName, InputDeviceWatcher.InputDeviceCategory device)
|
||||
{
|
||||
if (string.IsNullOrEmpty(spriteName)) return null;
|
||||
var t = GetTable(device);
|
||||
if (t != null)
|
||||
{
|
||||
for (int i = 0; i < t.entries.Count; ++i)
|
||||
{
|
||||
var e = t.entries[i];
|
||||
if (e != null && e.Sprite != null && string.Equals(e.Sprite.name, spriteName, StringComparison.OrdinalIgnoreCase)) return e;
|
||||
}
|
||||
}
|
||||
var kb = GetTable(InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
if (kb != null)
|
||||
{
|
||||
for (int i = 0; i < kb.entries.Count; ++i)
|
||||
{
|
||||
var e = kb.entries[i];
|
||||
if (e != null && e.Sprite != null && string.Equals(e.Sprite.name, spriteName, StringComparison.OrdinalIgnoreCase)) return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,12 +2,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using AlicizaX.InputGlyph;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.U2D;
|
||||
using TMPro;
|
||||
using UnityEngine.InputSystem;
|
||||
using InputGlyphsFramework;
|
||||
|
||||
[CustomEditor(typeof(InputGlyphDatabase))]
|
||||
public class InputGlyphDatabaseEditor : Editor
|
||||
@ -48,7 +47,6 @@ public class InputGlyphDatabaseEditor : Editor
|
||||
EnsureTableFor(InputDeviceWatcher.InputDeviceCategory.Keyboard);
|
||||
EnsureTableFor(InputDeviceWatcher.InputDeviceCategory.Xbox);
|
||||
EnsureTableFor(InputDeviceWatcher.InputDeviceCategory.PlayStation);
|
||||
EnsureTableFor(InputDeviceWatcher.InputDeviceCategory.Other);
|
||||
|
||||
var tableProp = GetTablePropertyFor(curDevice);
|
||||
if (tableProp == null)
|
||||
@ -111,6 +109,7 @@ public class InputGlyphDatabaseEditor : Editor
|
||||
for (int i = start; i < end; ++i)
|
||||
{
|
||||
var eProp = entries.GetArrayElementAtIndex(i);
|
||||
|
||||
if (eProp == null) continue;
|
||||
|
||||
using (new EditorGUILayout.HorizontalScope("box"))
|
||||
@ -144,15 +143,14 @@ public class InputGlyphDatabaseEditor : Editor
|
||||
// Right column: path + action should take the remaining width
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
var pathProp = eProp.FindPropertyRelative("controlPath");
|
||||
var actionProp = eProp.FindPropertyRelative("action");
|
||||
|
||||
EditorGUILayout.PropertyField(pathProp, GUIContent.none, GUILayout.ExpandWidth(true));
|
||||
|
||||
EditorGUILayout.Space(2);
|
||||
|
||||
EditorGUILayout.PropertyField(actionProp, GUIContent.none, GUILayout.ExpandWidth(true));
|
||||
|
||||
// if (glyphEntry != null && glyphEntry.action != null)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
@ -321,10 +319,9 @@ public class InputGlyphDatabaseEditor : Editor
|
||||
var entryProp = entriesProp.GetArrayElementAtIndex(newIndex);
|
||||
|
||||
var spriteProp = entryProp.FindPropertyRelative("Sprite");
|
||||
var controlPathProp = entryProp.FindPropertyRelative("controlPath");
|
||||
|
||||
|
||||
if (spriteProp != null) spriteProp.objectReferenceValue = s;
|
||||
if (controlPathProp != null) controlPathProp.stringValue = string.Empty;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
40
Client/Assets/InputGlyph/InputGlyphImage.cs
Normal file
40
Client/Assets/InputGlyph/InputGlyphImage.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.InputSystem;
|
||||
using AlicizaX.InputGlyph;
|
||||
|
||||
[RequireComponent(typeof(Image))]
|
||||
public class InputGlyphImage : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private InputActionReference actionReference;
|
||||
private Image targetImage;
|
||||
[SerializeField] private bool hideIfMissing = true;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (targetImage == null) targetImage = GetComponent<Image>();
|
||||
InputDeviceWatcher.OnDeviceChanged += OnDeviceChanged;
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
InputDeviceWatcher.OnDeviceChanged -= OnDeviceChanged;
|
||||
}
|
||||
|
||||
void OnDeviceChanged(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
void UpdatePrompt()
|
||||
{
|
||||
if (actionReference == null || actionReference.action == null || targetImage == null) return;
|
||||
InputDeviceWatcher.InputDeviceCategory deviceCategory = InputDeviceWatcher.CurrentCategory;
|
||||
string path = GlyphService.GetBindingControlPath(actionReference);
|
||||
if (GlyphService.TryGetUISpriteForActionPath(path, deviceCategory, out Sprite sprite))
|
||||
{
|
||||
targetImage.sprite = sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Client/Assets/InputGlyph/InputGlyphText.cs
Normal file
54
Client/Assets/InputGlyph/InputGlyphText.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using AlicizaX;
|
||||
using AlicizaX.InputGlyph;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
[RequireComponent(typeof(TextMeshProUGUI))]
|
||||
public class InputGlyphText : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private InputActionReference actionReference;
|
||||
private TMP_Text textField;
|
||||
void OnEnable()
|
||||
{
|
||||
if (textField == null) textField = GetComponent<TMP_Text>();
|
||||
InputDeviceWatcher.OnDeviceChanged += OnDeviceChanged;
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
InputDeviceWatcher.OnDeviceChanged -= OnDeviceChanged;
|
||||
}
|
||||
|
||||
void OnBindingChanged(InputAction action, int idx)
|
||||
{
|
||||
if (actionReference == null || actionReference.action == null) return;
|
||||
if (action == actionReference.action) UpdatePrompt();
|
||||
}
|
||||
|
||||
void OnDeviceChanged(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
UpdatePrompt();
|
||||
}
|
||||
|
||||
void UpdatePrompt()
|
||||
{
|
||||
if (actionReference == null || actionReference.action == null || textField == null) return;
|
||||
var action = actionReference.action;
|
||||
|
||||
string path = GlyphService.GetBindingControlPath(action);
|
||||
var device = InputDeviceWatcher.CurrentCategory;
|
||||
string displayFallback = string.Empty;
|
||||
string oldText = textField.text;
|
||||
if (GlyphService.TryGetTMPTagForActionPath(path, device, out string tag, out displayFallback))
|
||||
{
|
||||
textField.text = Utility.Text.Format(oldText, tag);
|
||||
return;
|
||||
}
|
||||
|
||||
textField.text = Utility.Text.Format(oldText, displayFallback);;
|
||||
}
|
||||
}
|
||||
@ -1,181 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace InputGlyphsFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Central input service. Holds reference to PlayerInput, loads/saves binding overrides,
|
||||
/// exposes simple helpers and broadcasts control-scheme and binding change events.
|
||||
/// </summary>
|
||||
[DefaultExecutionOrder(-200)]
|
||||
public class InputService : MonoBehaviour
|
||||
{
|
||||
public static InputService Instance { get; private set; }
|
||||
|
||||
[Header("References")] public PlayerInput playerInput;
|
||||
|
||||
[Header("Persistence")] public string bindingsPrefsKey = "bindings_v1";
|
||||
|
||||
// Events
|
||||
public event Action<InputAction, int> OnBindingChanged;
|
||||
public event Action<string> OnControlSchemeChanged;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
|
||||
if (playerInput == null) playerInput = GetComponent<PlayerInput>();
|
||||
|
||||
// subscribe to device watcher (user provided)
|
||||
try
|
||||
{
|
||||
InputDeviceWatcher.OnDeviceChanged += DeviceChanged;
|
||||
}
|
||||
catch
|
||||
{
|
||||
/* if DeviceInputWatcher not present at compile time ignore */
|
||||
}
|
||||
|
||||
if (playerInput != null)
|
||||
playerInput.onControlsChanged += PlayerInput_onControlsChanged;
|
||||
|
||||
// Load overrides if exist
|
||||
LoadOverridesFromPrefs();
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (Instance == this) Instance = null;
|
||||
try
|
||||
{
|
||||
InputDeviceWatcher.OnDeviceChanged -= DeviceChanged;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (playerInput != null) playerInput.onControlsChanged -= PlayerInput_onControlsChanged;
|
||||
}
|
||||
|
||||
private void PlayerInput_onControlsChanged(PlayerInput obj)
|
||||
{
|
||||
OnControlSchemeChanged?.Invoke(obj.currentControlScheme);
|
||||
}
|
||||
|
||||
private void DeviceChanged(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
// Map DeviceInputWatcher category to simple scheme string
|
||||
string scheme = "Keyboard";
|
||||
switch (cat)
|
||||
{
|
||||
case InputDeviceWatcher.InputDeviceCategory.Keyboard: scheme = "Keyboard"; break;
|
||||
case InputDeviceWatcher.InputDeviceCategory.Xbox: scheme = "Gamepad"; break;
|
||||
case InputDeviceWatcher.InputDeviceCategory.PlayStation: scheme = "Gamepad"; break;
|
||||
case InputDeviceWatcher.InputDeviceCategory.Other: scheme = "Keyboard"; break; // default to keyboard
|
||||
}
|
||||
|
||||
OnControlSchemeChanged?.Invoke(scheme);
|
||||
}
|
||||
|
||||
// Save overrides JSON
|
||||
public void SaveOverridesToPrefs()
|
||||
{
|
||||
if (playerInput == null || playerInput.actions == null) return;
|
||||
try
|
||||
{
|
||||
string json = playerInput.actions.SaveBindingOverridesAsJson();
|
||||
PlayerPrefs.SetString(bindingsPrefsKey, json);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning("InputService: Failed to save binding overrides: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
// Load overrides; if none present the action asset keeps defaults
|
||||
public void LoadOverridesFromPrefs()
|
||||
{
|
||||
if (playerInput == null || playerInput.actions == null) return;
|
||||
if (!PlayerPrefs.HasKey(bindingsPrefsKey)) return;
|
||||
var json = PlayerPrefs.GetString(bindingsPrefsKey);
|
||||
if (string.IsNullOrEmpty(json)) return;
|
||||
try
|
||||
{
|
||||
playerInput.actions.LoadBindingOverridesFromJson(json);
|
||||
// Notify listeners for all actions (best-effort)
|
||||
foreach (var map in playerInput.actions.actionMaps)
|
||||
{
|
||||
foreach (var action in map.actions)
|
||||
OnBindingChanged?.Invoke(action, -1);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning("InputService: Failed to load binding overrides: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string GetBindingDisplay(InputAction action)
|
||||
{
|
||||
if (action == null) return string.Empty;
|
||||
InputControl control = GetBindingControl(action);
|
||||
return control != null ? control.displayName : string.Empty;
|
||||
}
|
||||
|
||||
public static string GetBindingControlPath(InputAction action)
|
||||
{
|
||||
if (action == null) return string.Empty;
|
||||
InputControl control = GetBindingControl(action);
|
||||
return control != null ? control.path : string.Empty;
|
||||
}
|
||||
|
||||
public static InputControl GetBindingControl(InputAction action)
|
||||
{
|
||||
if (action == null) return null;
|
||||
var curCategory = InputDeviceWatcher.CurrentCategory;
|
||||
var curDeviceName = InputDeviceWatcher.CurrentDeviceName ?? "";
|
||||
var hints = GetDeviceHintsForCategory(curCategory);
|
||||
foreach (var control in action.controls)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(curDeviceName) && (control.device.displayName ?? "").Equals(curDeviceName, StringComparison.OrdinalIgnoreCase)
|
||||
|| hints.Any(h => (control.device.layout ?? "").ToLowerInvariant().Contains(h.ToLowerInvariant())))
|
||||
{
|
||||
return control;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static string[] GetDeviceHintsForCategory(InputDeviceWatcher.InputDeviceCategory cat)
|
||||
{
|
||||
switch (cat)
|
||||
{
|
||||
case InputDeviceWatcher.InputDeviceCategory.Keyboard:
|
||||
return new[] { "Keyboard", "Mouse" };
|
||||
case InputDeviceWatcher.InputDeviceCategory.Xbox:
|
||||
return new[] { "XInput", "Xbox", "Gamepad" };
|
||||
case InputDeviceWatcher.InputDeviceCategory.PlayStation:
|
||||
return new[] { "DualShock", "DualSense", "PlayStation", "Gamepad" };
|
||||
default:
|
||||
return new[] { "Gamepad", "Joystick", "Keyboard", "Mouse" };
|
||||
}
|
||||
}
|
||||
|
||||
// Notify when a binding was changed programmatically
|
||||
public void NotifyBindingChanged(InputAction action, int bindingIndex)
|
||||
{
|
||||
OnBindingChanged?.Invoke(action, bindingIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a8ba90f95814fee9a634c0a058ae90e
|
||||
timeCreated: 1764917453
|
||||
@ -1,157 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
||||
namespace InputGlyphsFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles interactive rebinding and conflict resolution for keyboard mappings.
|
||||
/// Conflicts are detected within configured scopes (e.g. Gameplay vs UI) and the conflicting binding(s)
|
||||
/// will be cleared (erased) while keeping the new mapping.
|
||||
/// </summary>
|
||||
[DefaultExecutionOrder(-150)]
|
||||
public class RebindManager : MonoBehaviour
|
||||
{
|
||||
public static RebindManager Instance { get; private set; }
|
||||
|
||||
[Tooltip("Action map names treated as Gameplay scope (conflicts resolved inside this group)")]
|
||||
public string[] gameplayMapNames = new string[] { "Player", "Other" };
|
||||
|
||||
[Tooltip("Action map names treated as UI scope")]
|
||||
public string[] uiMapNames = new string[] { "UI" };
|
||||
|
||||
[Header("Rebind Options")]
|
||||
public bool excludeMousePosition = true;
|
||||
public string cancelControl = "<Keyboard>/escape";
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this) { Destroy(this); return; }
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (Instance == this) Instance = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start interactive rebind on given action & bindingIndex. scope chooses which maps to treat as same-scope
|
||||
/// for conflict detection. Use scope = "Gameplay" or "UI".
|
||||
/// </summary>
|
||||
public void StartInteractiveRebind(InputActionReference actionRef, int bindingIndex, string scope = "Gameplay", Action onComplete = null)
|
||||
{
|
||||
if (actionRef == null || actionRef.action == null) return;
|
||||
var action = actionRef.action;
|
||||
|
||||
if (bindingIndex < 0 || bindingIndex >= action.bindings.Count)
|
||||
{
|
||||
Debug.LogWarning("RebindManager: bindingIndex out of range");
|
||||
return;
|
||||
}
|
||||
|
||||
var rebind = action.PerformInteractiveRebinding(bindingIndex)
|
||||
.WithCancelingThrough(cancelControl)
|
||||
.OnComplete(op =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var newPath = action.bindings[bindingIndex].effectivePath; // may be set via override
|
||||
|
||||
// Persist override for this binding
|
||||
action.ApplyBindingOverride(bindingIndex, newPath);
|
||||
|
||||
// Resolve conflicts inside scope (keyboard only)
|
||||
ResolveConflicts(action, bindingIndex, newPath, scope);
|
||||
|
||||
// Save using InputService
|
||||
if (InputService.Instance != null) InputService.Instance.SaveOverridesToPrefs();
|
||||
|
||||
// Notify
|
||||
if (InputService.Instance != null) InputService.Instance.NotifyBindingChanged(action, bindingIndex);
|
||||
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
finally
|
||||
{
|
||||
op.Dispose();
|
||||
}
|
||||
});
|
||||
|
||||
if (excludeMousePosition)
|
||||
rebind.WithControlsExcluding("<Mouse>/position");
|
||||
|
||||
rebind.Start();
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetMapsForScope(string scope)
|
||||
{
|
||||
if (string.Equals(scope, "UI", StringComparison.OrdinalIgnoreCase)) return uiMapNames;
|
||||
return gameplayMapNames;
|
||||
}
|
||||
|
||||
private void ResolveConflicts(InputAction changedAction, int changedBindingIndex, string newPath, string scope)
|
||||
{
|
||||
if (string.IsNullOrEmpty(newPath)) return;
|
||||
|
||||
// only care about keyboard rebinding conflicts
|
||||
if (!newPath.ToLowerInvariant().Contains("keyboard")) return;
|
||||
|
||||
var maps = GetMapsForScope(scope);
|
||||
if (maps == null || maps.Count() == 0) return;
|
||||
|
||||
if (InputService.Instance == null || InputService.Instance.playerInput == null) return;
|
||||
|
||||
var asset = InputService.Instance.playerInput.actions;
|
||||
var actionsToCheck = new List<(InputAction action, int bindingIndex)>();
|
||||
|
||||
// Gather candidates: all bindings in maps matching scope
|
||||
foreach (var map in asset.actionMaps)
|
||||
{
|
||||
if (!maps.Contains(map.name)) continue;
|
||||
foreach (var action in map.actions)
|
||||
{
|
||||
for (int i = 0; i < action.bindings.Count; ++i)
|
||||
{
|
||||
var b = action.bindings[i];
|
||||
// ignore the binding we just changed on the changedAction
|
||||
if (action == changedAction && i == changedBindingIndex) continue;
|
||||
|
||||
// consider only keyboard bindings (or empty path) for conflict
|
||||
var path = !string.IsNullOrEmpty(b.effectivePath) ? b.effectivePath : b.path;
|
||||
if (string.IsNullOrEmpty(path)) continue;
|
||||
|
||||
if (path.Equals(newPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
actionsToCheck.Add((action, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (actionsToCheck.Count == 0) return;
|
||||
|
||||
// Log conflicts, then clear conflicting bindings (erase)
|
||||
foreach (var item in actionsToCheck)
|
||||
{
|
||||
Debug.LogWarning($"Rebind conflict detected: New binding '{newPath}' for '{changedAction.name}' conflicts with '{item.action.name}' binding index {item.bindingIndex} (will be cleared)");
|
||||
|
||||
try
|
||||
{
|
||||
// Erase the conflicting binding entry
|
||||
item.action.ChangeBinding(item.bindingIndex).Erase();
|
||||
|
||||
// Notify for the cleared action
|
||||
if (InputService.Instance != null) InputService.Instance.NotifyBindingChanged(item.action, item.bindingIndex);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning("RebindManager: Failed to erase conflicting binding: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f11a72c144f842379864f906e23a2948
|
||||
timeCreated: 1764917487
|
||||
171
Client/Assets/InputGlyph/TestRebindScript.cs
Normal file
171
Client/Assets/InputGlyph/TestRebindScript.cs
Normal file
@ -0,0 +1,171 @@
|
||||
// TestRebindScript.cs
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using InputRemapper;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TestRebindScript : MonoBehaviour
|
||||
{
|
||||
[Header("UI")]
|
||||
public UXButton btn;
|
||||
public TextMeshProUGUI bindKeyText;
|
||||
public Image targetImage;
|
||||
|
||||
[Tooltip("如果不使用 actionReference,则用 name 在全局 manager 查找")]
|
||||
public string actionName = "movement";
|
||||
|
||||
[Header("Optional composite part (WASD style)")]
|
||||
[Tooltip("如果需要绑定 composite 的某一部分(例如 Up/Down/Left/Right),填这个;留空表示绑定非 composite 或整体 binding")]
|
||||
public string compositePartName = "";
|
||||
|
||||
[Header("Behavior")]
|
||||
[Tooltip("如果 true,在 Prepare 后自动调用 ConfirmApply() 并保存;否则等待手动 ConfirmPrepared()/CancelPrepared()")]
|
||||
public bool autoConfirm = false;
|
||||
|
||||
private int targetBindingIndex = -1;
|
||||
private IDisposable prepareSub;
|
||||
private IDisposable applySub;
|
||||
private IDisposable rebindEndSub;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (btn != null) btn.onClick.AddListener(OnBtnClicked);
|
||||
InputDeviceWatcher.OnDeviceChanged += OnDeviceChanged;
|
||||
|
||||
ResolveBindingIndex();
|
||||
UpdateBindingText();
|
||||
|
||||
if (InputBindingManager.Instance != null)
|
||||
{
|
||||
prepareSub = InputBindingManager.Instance.OnRebindPrepare.Subscribe(ctx =>
|
||||
{
|
||||
if (IsTargetContext(ctx))
|
||||
{
|
||||
var disp = ctx.overridePath == InputBindingManager.NULL_BINDING ? "<Cleared>" : ctx.overridePath;
|
||||
bindKeyText.text = disp;
|
||||
if (autoConfirm) _ = ConfirmPreparedAsync();
|
||||
}
|
||||
});
|
||||
|
||||
applySub = InputBindingManager.Instance.OnApply.Subscribe(_ => UpdateBindingText());
|
||||
rebindEndSub = InputBindingManager.Instance.OnRebindEnd.Subscribe(_ => UpdateBindingText());
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (btn != null) btn.onClick.RemoveListener(OnBtnClicked);
|
||||
InputDeviceWatcher.OnDeviceChanged -= OnDeviceChanged;
|
||||
prepareSub?.Dispose();
|
||||
applySub?.Dispose();
|
||||
rebindEndSub?.Dispose();
|
||||
}
|
||||
|
||||
private void OnDeviceChanged(InputDeviceWatcher.InputDeviceCategory _)
|
||||
{
|
||||
UpdateBindingText();
|
||||
}
|
||||
|
||||
private InputAction GetAction()
|
||||
{
|
||||
return InputBindingManager.Action(actionName);
|
||||
}
|
||||
|
||||
private void ResolveBindingIndex()
|
||||
{
|
||||
var action = GetAction();
|
||||
if (action == null)
|
||||
{
|
||||
Debug.LogError($"TestRebindScript: Action not found ('{actionName}').");
|
||||
targetBindingIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
// Ask manager to choose best index for keyboard and optional composite part
|
||||
targetBindingIndex = InputBindingManager.Instance.FindBestBindingIndexForKeyboard(action, string.IsNullOrEmpty(compositePartName) ? null : compositePartName);
|
||||
}
|
||||
|
||||
private bool IsTargetContext(InputRemapper.InputBindingManager.RebindContext ctx)
|
||||
{
|
||||
if (ctx == null || ctx.action == null) return false;
|
||||
var action = GetAction();
|
||||
if (action == null) return false;
|
||||
return ctx.action == action && ctx.bindingIndex == targetBindingIndex;
|
||||
}
|
||||
|
||||
private void OnBtnClicked()
|
||||
{
|
||||
// Use manager API (we pass part name so manager can pick proper binding if needed)
|
||||
InputBindingManager.StartRebind(actionName, string.IsNullOrEmpty(compositePartName) ? null : compositePartName);
|
||||
}
|
||||
|
||||
public async void ConfirmPrepared()
|
||||
{
|
||||
bool ok = await ConfirmPreparedAsync();
|
||||
if (!ok) Debug.LogError("ConfirmPrepared: apply failed.");
|
||||
}
|
||||
|
||||
private async Task<bool> ConfirmPreparedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var task = InputBindingManager.ConfirmApply();
|
||||
if (task == null) return false;
|
||||
return await task;
|
||||
}
|
||||
catch (Exception ex) { Debug.LogError(ex); return false; }
|
||||
}
|
||||
|
||||
public void CancelPrepared()
|
||||
{
|
||||
InputBindingManager.DiscardPrepared();
|
||||
UpdateBindingText();
|
||||
}
|
||||
|
||||
private void UpdateBindingText()
|
||||
{
|
||||
var action = GetAction();
|
||||
if (action == null)
|
||||
{
|
||||
bindKeyText.text = "<no action>";
|
||||
if (targetImage != null) targetImage.sprite = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure binding index is refreshed (action/bindings may change)
|
||||
if (targetBindingIndex < 0 || targetBindingIndex >= action.bindings.Count)
|
||||
ResolveBindingIndex();
|
||||
|
||||
if (targetBindingIndex < 0)
|
||||
{
|
||||
bindKeyText.text = "<no binding>";
|
||||
if (targetImage != null) targetImage.sprite = null;
|
||||
return;
|
||||
}
|
||||
|
||||
string disp = action.GetBindingDisplayString(targetBindingIndex);
|
||||
bindKeyText.text = string.IsNullOrEmpty(disp) ? "<unbound>" : disp;
|
||||
|
||||
// **Important**: use GlyphService with InputAction and device category (not manager-internal path)
|
||||
try
|
||||
{
|
||||
var deviceCat = InputDeviceWatcher.CurrentCategory;
|
||||
string controlPath = GlyphService.GetBindingControlPath(action, deviceCat);
|
||||
if (!string.IsNullOrEmpty(controlPath) && GlyphService.TryGetUISpriteForActionPath(controlPath, deviceCat, out Sprite sprite))
|
||||
{
|
||||
if (targetImage != null) targetImage.sprite = sprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetImage != null) targetImage.sprite = null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (targetImage != null) targetImage.sprite = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Client/Assets/InputGlyph/TestRebindScript.cs.meta
Normal file
11
Client/Assets/InputGlyph/TestRebindScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ec2871cc330674438e5ae0aea9e616b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -443,7 +443,7 @@
|
||||
"name": "input.action.inventory",
|
||||
"type": "Button",
|
||||
"id": "dd2256ca-b262-4d3e-9407-abcdc8d38915",
|
||||
"expectedControlType": "Button",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
@ -461,7 +461,7 @@
|
||||
"name": "input.action.inventory.rotate",
|
||||
"type": "Button",
|
||||
"id": "6d36ffc9-4e4f-4f31-ae51-b0f63ed56cf7",
|
||||
"expectedControlType": "Button",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
@ -470,7 +470,7 @@
|
||||
"name": "input.action.inventory.move",
|
||||
"type": "Button",
|
||||
"id": "6387b579-013a-4382-bda0-28fc2ad1e725",
|
||||
"expectedControlType": "Button",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
@ -479,7 +479,7 @@
|
||||
"name": "input.action.inventory.select",
|
||||
"type": "Button",
|
||||
"id": "84379244-e40e-4d31-a4c4-96f77c4255d5",
|
||||
"expectedControlType": "Button",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
@ -488,7 +488,7 @@
|
||||
"name": "input.action.cursor",
|
||||
"type": "Button",
|
||||
"id": "e3714b6c-cf9a-46f5-8aad-28c4ad52e3a9",
|
||||
"expectedControlType": "Button",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
@ -510,6 +510,24 @@
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
"name": "Preview",
|
||||
"type": "Button",
|
||||
"id": "d6ae14a0-67b5-4ebb-9338-97533d0153c5",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
"name": "Next",
|
||||
"type": "Button",
|
||||
"id": "47edcb97-6584-45f3-9591-5bd33f40be8c",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
@ -655,6 +673,50 @@
|
||||
"action": "Cancel",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "17fb06a7-5709-4f63-b279-464e756922dd",
|
||||
"path": "<Keyboard>/q",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Preview",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "eb1a9fe2-d96d-4507-898f-a7f3c7722746",
|
||||
"path": "<Gamepad>/leftShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Preview",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "e618d2d2-4e76-4878-96d9-c2b88f950881",
|
||||
"path": "<Keyboard>/e",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Next",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "c1e1738f-9285-494a-a8a0-f2cdd317b028",
|
||||
"path": "<Gamepad>/rightShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Next",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 777a45b1b56a4ef6866011a0f739705a
|
||||
guid: 04032650818d79e458126e67e973df69
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
23
Client/Assets/Plugins/Rx.NET/LICENSE.txt
Normal file
23
Client/Assets/Plugins/Rx.NET/LICENSE.txt
Normal file
@ -0,0 +1,23 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) .NET Foundation and Contributors
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
7
Client/Assets/Plugins/Rx.NET/LICENSE.txt.meta
Normal file
7
Client/Assets/Plugins/Rx.NET/LICENSE.txt.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00562fa3f2d40fb4cad9d80e0a1385f3
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Client/Assets/Plugins/Rx.NET/System.Reactive.dll
Normal file
BIN
Client/Assets/Plugins/Rx.NET/System.Reactive.dll
Normal file
Binary file not shown.
33
Client/Assets/Plugins/Rx.NET/System.Reactive.dll.meta
Normal file
33
Client/Assets/Plugins/Rx.NET/System.Reactive.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e7b3ec3c202152428745329c4369f51
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
28230
Client/Assets/Plugins/Rx.NET/System.Reactive.xml
Normal file
28230
Client/Assets/Plugins/Rx.NET/System.Reactive.xml
Normal file
File diff suppressed because it is too large
Load Diff
7
Client/Assets/Plugins/Rx.NET/System.Reactive.xml.meta
Normal file
7
Client/Assets/Plugins/Rx.NET/System.Reactive.xml.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a4d1e62073a8414c9539d29dae487a2
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using AlicizaX.UI;
|
||||
using UnityEngine;
|
||||
using AlicizaX.UI.Runtime;
|
||||
namespace Game.UI
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using AlicizaX.UI;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using AlicizaX.UI.Runtime;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,14 +1,19 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AlicizaX.InputGlyph;
|
||||
using AlicizaX.UI;
|
||||
using AlicizaX.UI.Extension;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TestAudioPlay : MonoBehaviour
|
||||
{
|
||||
public InputGlyphDatabase database;
|
||||
public AudioSource audioSource;
|
||||
[SerializeField] private UXHotkey[] hotButtons;
|
||||
|
||||
[SerializeField] private UXHotkeyButton[] hotButtons;
|
||||
Slider slider;
|
||||
private Selectable Selectable;
|
||||
public class UXAuditoHelper : IUXAudioHelper
|
||||
{
|
||||
private AudioSource _audioSource;
|
||||
@ -46,6 +51,7 @@ public class TestAudioPlay : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
GlyphService.Database = database;
|
||||
UXComponentExtensionsHelper.SetAudioHelper(new UXAuditoHelper(audioSource));
|
||||
BindHotKeys();
|
||||
}
|
||||
|
||||
1
Client/Assets/input_bindings.json
Normal file
1
Client/Assets/input_bindings.json
Normal file
@ -0,0 +1 @@
|
||||
{"bindings":[{"action":"input.map.player/input.action.movement","id":"15d59094-85d1-408d-b565-724532c15263","path":"<Keyboard>/v","interactions":"null","processors":"null"}]}
|
||||
7
Client/Assets/input_bindings.json.meta
Normal file
7
Client/Assets/input_bindings.json.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7146227e7944210459dc3721fc1b10c4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1 +1 @@
|
||||
Subproject commit 0045d5a7e12a76bc3218ae6d3a6eb38e7882d78e
|
||||
Subproject commit c202e21af085f26c4cf1dd6459c1e13cfc7ff162
|
||||
@ -1 +1 @@
|
||||
Subproject commit 967ad4fc8c907a8439c25dea64e74551e5437c18
|
||||
Subproject commit d17eaaaa8b9fbdc64b1e1b1cf48c7b9d79957fb7
|
||||
@ -10,7 +10,7 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using YooAsset.Editor;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class AlicizaUXUIGeneratorRuleHelper : IUIGeneratorRuleHelper
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
internal class ScriptableSingleton<T> : ScriptableObject where T : ScriptableObject
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static partial class ContextMenuUtils
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static partial class ContextMenuUtils
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class FindContainerLogic
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
//所有需要执行撤销的操作 在这里定义Commond,通过Execute执行Undo记录
|
||||
//目的是为了不让Undo. 代码乱飞
|
||||
|
||||
@ -18,7 +18,7 @@ using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
|
||||
using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility;
|
||||
#endif
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static partial class Utils
|
||||
{
|
||||
@ -38,7 +38,7 @@ namespace Aliciza.UXTool
|
||||
[Obsolete]
|
||||
public static EditorWindow GetGameView()
|
||||
{
|
||||
var type = typeof(Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
var type = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
var gameview = EditorWindow.GetWindow(type);
|
||||
return gameview;
|
||||
}
|
||||
@ -92,19 +92,19 @@ namespace Aliciza.UXTool
|
||||
return editorWindow;
|
||||
}
|
||||
|
||||
public static Editor GetEditor(Object[] targets, string EditorClassName)
|
||||
public static UnityEditor.Editor GetEditor(Object[] targets, string EditorClassName)
|
||||
{
|
||||
var assembly = typeof(Editor).Assembly;
|
||||
var assembly = typeof(UnityEditor.Editor).Assembly;
|
||||
var type = assembly.GetType(EditorClassName);
|
||||
var editor = Editor.CreateEditor(targets, type);
|
||||
var editor = UnityEditor.Editor.CreateEditor(targets, type);
|
||||
return editor;
|
||||
}
|
||||
|
||||
public static Editor GetEditor(Object target, string EditorClassName)
|
||||
public static UnityEditor.Editor GetEditor(Object target, string EditorClassName)
|
||||
{
|
||||
var assembly = typeof(Editor).Assembly;
|
||||
var assembly = typeof(UnityEditor.Editor).Assembly;
|
||||
var type = assembly.GetType(EditorClassName);
|
||||
var editor = Editor.CreateEditor(target, type);
|
||||
var editor = UnityEditor.Editor.CreateEditor(target, type);
|
||||
return editor;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
[System.Serializable]
|
||||
[FilePath("ProjectSettings/UXPrefabTabsConfig.asset")]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class Def_UXGUIPath
|
||||
{
|
||||
|
||||
@ -8,7 +8,7 @@ using UnityEngine.UIElements;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class SceneViewContextMenu
|
||||
{
|
||||
@ -214,7 +214,7 @@ namespace Aliciza.UXTool
|
||||
}
|
||||
else
|
||||
{
|
||||
Scene scene = SceneManager.GetActiveScene();
|
||||
UnityEngine.SceneManagement.Scene scene = SceneManager.GetActiveScene();
|
||||
GameObject[] rootObjects = scene.GetRootGameObjects();
|
||||
foreach (GameObject rootObj in rootObjects)
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@ using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class UXControllerAddWindow : EditorWindow
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using FontStyle = UnityEngine.FontStyle;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class UXControllerEditWindow : EditorWindow
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Aliciza.UXTool;
|
||||
using AlicizaX.UXTool;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Experimental.SceneManagement;
|
||||
using UnityEditor.SceneManagement;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Aliciza.UXTool;
|
||||
using AlicizaX.UI.Runtime;
|
||||
using AlicizaX.UXTool;
|
||||
using AlicizaX.UI;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEditor.Experimental.SceneManagement;
|
||||
@ -1288,6 +1288,7 @@ public class UXHierarchyWindow : EditorWindow
|
||||
evt.menu.AppendAction("UXButton", a => { UXCreateHelper.CreateUXButton(command); }, a => DropdownMenuAction.Status.Normal);
|
||||
evt.menu.AppendAction("UXInput Field", a => { UXCreateHelper.CreateUXInputField(command); }, a => DropdownMenuAction.Status.Normal);
|
||||
evt.menu.AppendAction("UXScrollView", a => { UXCreateHelper.CreateUxRecyclerView(); }, a => DropdownMenuAction.Status.Normal);
|
||||
evt.menu.AppendAction("UXSlider", a => { UXCreateHelper.CreateUXSlider(command); }, a => DropdownMenuAction.Status.Normal);
|
||||
}
|
||||
|
||||
private void CreateControlerUIMenu(ContextualMenuPopulateEvent evt, GameObject target)
|
||||
|
||||
@ -5,7 +5,7 @@ using System.IO;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class PrefabSingleTab : VisualElement
|
||||
{
|
||||
|
||||
@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UXScroller = UnityEngine.UIElements.Scroller;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class PrefabTabs
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Aliciza.UXTool;
|
||||
using AlicizaX.UXTool;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@ -6,7 +6,7 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class ResolutionController
|
||||
{
|
||||
@ -154,7 +154,7 @@ namespace Aliciza.UXTool
|
||||
// 如果为空,尝试从类型查找已存在的 GameView 实例
|
||||
if (gameViewInstance == null)
|
||||
{
|
||||
var gvType = typeof(Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
var gvType = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
if (gvType != null)
|
||||
{
|
||||
var arr = Resources.FindObjectsOfTypeAll(gvType);
|
||||
@ -167,13 +167,13 @@ namespace Aliciza.UXTool
|
||||
return false;
|
||||
|
||||
var editorGUILayoutType = Type.GetType("UnityEditor.EditorGUILayout,UnityEditor")
|
||||
?? typeof(Editor).Assembly.GetType("UnityEditor.EditorGUILayout");
|
||||
?? typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.EditorGUILayout");
|
||||
if (editorGUILayoutType != null)
|
||||
{
|
||||
gameViewSizePopupMethod = editorGUILayoutType.GetMethod("GameViewSizePopup", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
|
||||
}
|
||||
|
||||
var gameViewType = typeof(Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
var gameViewType = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.GameView");
|
||||
if (gameViewType == null) return false;
|
||||
|
||||
selectedSizeIndexProperty = gameViewType.GetProperty("selectedSizeIndex", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using System.Linq;
|
||||
using Aliciza.UXTool;
|
||||
using AlicizaX.UXTool;
|
||||
using AlicizaX.AnimationFlow.Runtime;
|
||||
using AlicizaX.Localization.Editor;
|
||||
using AlicizaX.Localization.Runtime;
|
||||
@ -9,7 +9,7 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
[MainToolbarElement("ToolBarUXAnimation", alignment: ToolbarAlign.Right, order: 1)]
|
||||
public class ToolBarUXAnimation : IMGUIContainer
|
||||
@ -45,9 +45,9 @@ namespace Aliciza.UXTool
|
||||
if (GUILayout.Button(btnAnimation, EditorStyles.toolbarButton, GUILayout.MaxWidth(120)))
|
||||
{
|
||||
var gameObject = PrefabStageUtils.StageRoot.gameObject;
|
||||
if (!gameObject.TryGetComponent(typeof(AnimationFlow), out Component flow))
|
||||
if (!gameObject.TryGetComponent(typeof(AnimationFlow.Runtime.AnimationFlow), out Component flow))
|
||||
{
|
||||
gameObject.AddComponent(typeof(AnimationFlow));
|
||||
gameObject.AddComponent(typeof(AnimationFlow.Runtime.AnimationFlow));
|
||||
}
|
||||
Selection.activeGameObject = PrefabStageUtils.StageRoot.gameObject;
|
||||
UnityEditor.EditorApplication.ExecuteMenuItem("Window/AnimationGraph");
|
||||
|
||||
@ -3,7 +3,7 @@ using UnityEditor.Overlays;
|
||||
using UnityEditor.Toolbars;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
[Overlay(typeof(SceneView), "Align")]
|
||||
public class AlignToolbarOverlay : ToolbarOverlay
|
||||
|
||||
@ -8,7 +8,7 @@ using UnityEngine.UIElements;
|
||||
using Button = UnityEngine.UIElements.Button;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public enum UXComponentType
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public class UXComponentCreateWindow : EditorWindow
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Aliciza.UXTool;
|
||||
using AlicizaX.UXTool;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class UIBuilderUtil
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ using UnityEditor.Callbacks;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class UXDesinUtil
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliciza.UXTool
|
||||
namespace AlicizaX.UXTool
|
||||
{
|
||||
public static class UXSelectionUtil
|
||||
{
|
||||
|
||||
@ -27,14 +27,14 @@ EditorUserSettings:
|
||||
value: 07570502540759090e59587047775c48414f1b7d757924687d714432e6b93561
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-6:
|
||||
value: 5a07065703500c59585e0e7748770d44444f4a737d2d7f35787d4f63e0b26668
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-7:
|
||||
value: 54010c54510c5a5f5a0a0973477b0a4414151a2b757925367a7e4a6ab1b66260
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-8:
|
||||
RecentlyUsedSceneGuid-7:
|
||||
value: 50500404540c580d0f0b5e7543725b44424f4c7a7b7c7734747e4f36e4b1676d
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-8:
|
||||
value: 5a07065703500c59585e0e7748770d44444f4a737d2d7f35787d4f63e0b26668
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-9:
|
||||
value: 015450045700505d0f0a5f2313260a444e164b2e757b76652c2d4d32bab0313a
|
||||
flags: 0
|
||||
|
||||
@ -49,9 +49,9 @@ MonoBehaviour:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 594
|
||||
width: 500
|
||||
height: 405
|
||||
y: 466
|
||||
width: 788
|
||||
height: 533
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
m_PreferredDataMode: 0
|
||||
@ -104,23 +104,23 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 21
|
||||
width: 500
|
||||
height: 384
|
||||
m_Scale: {x: 0.26041666, y: 0.26041666}
|
||||
m_Translation: {x: 250, y: 192}
|
||||
width: 788
|
||||
height: 512
|
||||
m_Scale: {x: 0.41041666, y: 0.41041666}
|
||||
m_Translation: {x: 394, y: 256}
|
||||
m_MarginLeft: 0
|
||||
m_MarginRight: 0
|
||||
m_MarginTop: 0
|
||||
m_MarginBottom: 0
|
||||
m_LastShownAreaInsideMargins:
|
||||
serializedVersion: 2
|
||||
x: -960.00006
|
||||
y: -737.28
|
||||
width: 1920.0001
|
||||
height: 1474.56
|
||||
x: -960
|
||||
y: -623.75635
|
||||
width: 1920
|
||||
height: 1247.5127
|
||||
m_MinimalGUI: 1
|
||||
m_defaultScale: 0.26041666
|
||||
m_LastWindowPixelSize: {x: 500, y: 405}
|
||||
m_defaultScale: 0.41041666
|
||||
m_LastWindowPixelSize: {x: 788, y: 533}
|
||||
m_ClearInEditMode: 1
|
||||
m_NoCameraWarning: 1
|
||||
m_LowResolutionForAspectRatios: 01000000000000000000
|
||||
@ -145,7 +145,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 501
|
||||
width: 789
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
@ -162,23 +162,23 @@ MonoBehaviour:
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 1
|
||||
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name: SceneView
|
||||
m_Name: AnimatorControllerTool
|
||||
m_EditorClassIdentifier:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 501
|
||||
height: 521
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_ActualView: {fileID: 6}
|
||||
width: 789
|
||||
height: 393
|
||||
m_MinSize: {x: 101, y: 121}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 5}
|
||||
m_Panes:
|
||||
- {fileID: 5}
|
||||
- {fileID: 6}
|
||||
m_Selected: 1
|
||||
m_LastSelected: 0
|
||||
m_Selected: 0
|
||||
m_LastSelected: 1
|
||||
--- !u!114 &5
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
@ -201,8 +201,8 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 73
|
||||
width: 518
|
||||
height: 926
|
||||
width: 788
|
||||
height: 372
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
m_PreferredDataMode: 0
|
||||
@ -271,8 +271,8 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 73
|
||||
width: 500
|
||||
height: 500
|
||||
width: 520
|
||||
height: 342
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
m_PreferredDataMode: 0
|
||||
@ -287,7 +287,7 @@ MonoBehaviour:
|
||||
floating: 0
|
||||
collapsed: 0
|
||||
displayed: 1
|
||||
snapOffset: {x: -174, y: -26}
|
||||
snapOffset: {x: -179, y: -26}
|
||||
snapOffsetDelta: {x: 0, y: 0}
|
||||
snapCorner: 3
|
||||
id: Tool Settings
|
||||
@ -813,9 +813,9 @@ MonoBehaviour:
|
||||
m_PlayAudio: 0
|
||||
m_AudioPlay: 0
|
||||
m_Position:
|
||||
m_Target: {x: 1408.7655, y: 188.15186, z: -0.5922277}
|
||||
m_Target: {x: 1204.4852, y: 251.26892, z: -1.0785128}
|
||||
speed: 2
|
||||
m_Value: {x: 1404.5662, y: 193.512, z: -0.66870356}
|
||||
m_Value: {x: 1204.4852, y: 251.26892, z: -1.0785128}
|
||||
m_RenderMode: 0
|
||||
m_CameraMode:
|
||||
drawMode: 0
|
||||
@ -865,9 +865,9 @@ MonoBehaviour:
|
||||
speed: 2
|
||||
m_Value: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_Size:
|
||||
m_Target: 162.29886
|
||||
m_Target: 210.92734
|
||||
speed: 2
|
||||
m_Value: 169.94644
|
||||
m_Value: 210.92734
|
||||
m_Ortho:
|
||||
m_Target: 1
|
||||
speed: 2
|
||||
@ -908,11 +908,11 @@ MonoBehaviour:
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 521
|
||||
width: 501
|
||||
height: 426
|
||||
m_MinSize: {x: 50, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
y: 393
|
||||
width: 789
|
||||
height: 554
|
||||
m_MinSize: {x: 51, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 2}
|
||||
m_Panes:
|
||||
- {fileID: 2}
|
||||
@ -935,14 +935,14 @@ MonoBehaviour:
|
||||
- {fileID: 11}
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 501
|
||||
x: 789
|
||||
y: 0
|
||||
width: 332
|
||||
width: 217
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
vertical: 1
|
||||
controlID: 25624
|
||||
controlID: 49
|
||||
draggingID: 0
|
||||
--- !u!114 &9
|
||||
MonoBehaviour:
|
||||
@ -961,10 +961,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 332
|
||||
height: 582
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
width: 217
|
||||
height: 583
|
||||
m_MinSize: {x: 202, y: 221}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 10}
|
||||
m_Panes:
|
||||
- {fileID: 10}
|
||||
@ -990,10 +990,10 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 501
|
||||
x: 789
|
||||
y: 73
|
||||
width: 330
|
||||
height: 561
|
||||
width: 215
|
||||
height: 562
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
m_PreferredDataMode: 0
|
||||
@ -1007,9 +1007,9 @@ MonoBehaviour:
|
||||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: 1cb1ffff
|
||||
m_LastClickedID: -20196
|
||||
m_ExpandedIDs: 20b1ffff34b1ffff1cfbffffc86d00009e6e0000
|
||||
m_SelectedIDs: 8cfaffff
|
||||
m_LastClickedID: -1396
|
||||
m_ExpandedIDs: c8fafffffa6d0000166f0000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@ -1025,7 +1025,7 @@ MonoBehaviour:
|
||||
m_IsRenaming: 0
|
||||
m_OriginalEventType: 11
|
||||
m_IsRenamingFilename: 0
|
||||
m_ClientGUIView: {fileID: 4}
|
||||
m_ClientGUIView: {fileID: 9}
|
||||
m_SearchString:
|
||||
m_ExpandedScenes: []
|
||||
m_CurrenRootInstanceID: 0
|
||||
@ -1049,11 +1049,11 @@ MonoBehaviour:
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 582
|
||||
width: 332
|
||||
height: 365
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
y: 583
|
||||
width: 217
|
||||
height: 364
|
||||
m_MinSize: {x: 102, y: 121}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 12}
|
||||
m_Panes:
|
||||
- {fileID: 12}
|
||||
@ -1079,10 +1079,10 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 501
|
||||
y: 655
|
||||
width: 330
|
||||
height: 344
|
||||
x: 789
|
||||
y: 656
|
||||
width: 215
|
||||
height: 343
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
m_PreferredDataMode: 0
|
||||
@ -1108,9 +1108,9 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 833
|
||||
x: 1006
|
||||
y: 0
|
||||
width: 470
|
||||
width: 341
|
||||
height: 947
|
||||
m_MinSize: {x: 232, y: 271}
|
||||
m_MaxSize: {x: 10002, y: 10021}
|
||||
@ -1139,9 +1139,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 833
|
||||
y: 73
|
||||
width: 468
|
||||
x: 1007
|
||||
y: 19
|
||||
width: 339
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1164,7 +1164,7 @@ MonoBehaviour:
|
||||
m_SkipHidden: 0
|
||||
m_SearchArea: 0
|
||||
m_Folders:
|
||||
- Assets/InputIcons/source/keyboard_White
|
||||
- Assets/InputGlyph
|
||||
m_Globs: []
|
||||
m_OriginalText:
|
||||
m_ImportLogFlags: 0
|
||||
@ -1180,7 +1180,7 @@ MonoBehaviour:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: e48c0000
|
||||
m_LastClickedID: 36068
|
||||
m_ExpandedIDs: ffffffff0000000070710000727100007471000076710000787100007a7100007c7100007e71000080710000827100008471000086710000887100008a7100008c7100008e71000090710000927100009471000096710000987100009a7100009c7100009e710000a0710000a2710000a4710000a6710000a8710000aa710000ac710000ae710000b0710000b2710000b4710000b6710000b8710000ba710000bc710000be710000c0710000c2710000c4710000c6710000c8710000ca710000cc710000ce710000d0710000d2710000d4710000d6710000d8710000da710000dc710000de710000e0710000e2710000e4710000e6710000e8710000ea710000ec710000ee710000f0710000f2710000f4710000f6710000f8710000fa710000fc710000fe71000000720000027200000472000006720000087200000a7200000c7200000e72000010720000127200001472000016720000187200001a7200001c7200001e72000020720000227200002472000026720000287200002a7200002c7200002e72000030720000327200003472000036720000387200003a7200003c7200003e72000040720000427200004472000046720000487200004a7200004c7200004e72000050720000527200005472000056720000587200005a7200005c7200005e72000060720000627200006472000066720000687200006a7200006c7200006e72000070720000727200007472000076720000787200007a7200007c7200007e72000080720000827200008472000086720000887200008a7200008c7200008e72000090720000927200009472000096720000987200009a7200009c7200009e720000a0720000a2720000a4720000a6720000a8720000aa720000ac720000ae720000b0720000b2720000b4720000b6720000b8720000ba720000bc720000be720000c0720000c2720000c4720000c6720000c8720000ca720000cc720000ce720000d2720000d4720000d6720000d8720000da720000dc720000de720000e0720000e2720000e4720000e6720000e8720000ea720000ec720000ee720000f0720000f2720000f4720000f8720000fa720000fc720000fe72000000730000027300000473000006730000087300000a7300000c7300000e730000107300001273000014730000167300001a7300001c7300001e730000207300002273000024730000267300002c7300008e730000587700005e77000058790000e67c0000047d00000c7d0000de820000e8820000ffffff7f
|
||||
m_ExpandedIDs: 00000000e26f000092720000487400004a7400004c7400004e74000050740000527400005474000056740000587400005a7400005c7400005e74000060740000627400006474000066740000687400006a7400006c7400006e74000070740000727400007474000076740000787400007a7400007c7400007e74000080740000827400008474000086740000887400008a7400008c7400008e74000090740000927400009474000096740000987400009a7400009c7400009e740000a0740000a2740000a4740000a6740000a8740000aa740000ac740000ae740000b0740000b2740000b4740000b6740000b8740000ba740000bc740000be740000c0740000c2740000c4740000c6740000c8740000ca740000cc740000ce740000d0740000d2740000d4740000d6740000d8740000da740000dc740000de740000e0740000e2740000e4740000e6740000e8740000ea740000ec740000ee740000f0740000f2740000f4740000f6740000f8740000fa740000fc740000fe74000000750000027500000475000006750000087500000a7500000c7500000e75000010750000127500001475000016750000187500001a7500001c7500001e75000020750000227500002475000026750000287500002a7500002c7500002e75000030750000327500003475000036750000387500003a7500003c7500003e75000040750000427500004475000046750000487500004a7500004c7500004e75000050750000527500005475000056750000587500005a7500005c7500005e75000060750000627500006475000066750000687500006a7500006c7500006e75000070750000727500007475000076750000787500007a7500007c7500007e75000080750000827500008475000086750000887500008a7500008c7500008e75000090750000927500009475000096750000987500009a7500009c7500009e750000a0750000a2750000a4750000a6750000a8750000aa750000ac750000ae750000b0750000b2750000b4750000b6750000b8750000ba750000bc750000be750000c0750000c2750000c4750000c6750000c8750000ca750000cc750000ce750000d0750000d2750000d4750000d6750000d8750000da750000dc750000de750000e0750000e2750000e4750000e6750000e8750000ea750000ec750000ee750000f0750000f2750000f4750000f6750000f8750000fa750000fc750000fe75000000760000027600000476000006760000087600000a7600000c7600000e7600001076000012760000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@ -1205,24 +1205,24 @@ MonoBehaviour:
|
||||
m_Icon: {fileID: 0}
|
||||
m_ResourceFile:
|
||||
m_AssetTreeState:
|
||||
scrollPos: {x: 0, y: 1020}
|
||||
m_SelectedIDs: 1cb1ffff
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: 8cfaffff
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: ffffffff0000000070710000727100007471000076710000787100007a7100007c7100007e71000080710000827100008471000086710000887100008a7100008c7100008e71000090710000927100009471000096710000987100009a7100009c7100009e710000a0710000a2710000a4710000a6710000a8710000aa710000ac710000ae710000b0710000b2710000b4710000b6710000b8710000ba710000bc710000be710000c0710000c2710000c4710000c6710000c8710000ca710000cc710000ce710000d0710000d2710000d4710000d6710000d8710000da710000dc710000de710000e0710000e2710000e4710000e6710000e8710000ea710000ec710000ee710000f0710000f2710000f4710000f6710000f8710000fa710000fc710000fe71000000720000027200000472000006720000087200000a7200000c7200000e72000010720000127200001472000016720000187200001a7200001c7200001e72000020720000227200002472000026720000287200002a7200002c7200002e72000030720000327200003472000036720000387200003a7200003c7200003e72000040720000427200004472000046720000487200004a7200004c7200004e72000050720000527200005472000056720000587200005a7200005c7200005e72000060720000627200006472000066720000687200006a7200006c7200006e72000070720000727200007472000076720000787200007a7200007c7200007e72000080720000827200008472000086720000887200008a7200008c7200008e72000090720000927200009472000096720000987200009a7200009c7200009e720000a0720000a2720000a4720000a6720000a8720000aa720000ac720000ae720000b0720000b2720000b4720000b6720000b8720000ba720000bc720000be720000c0720000c2720000c4720000c6720000c8720000ca720000cc720000ce720000d2720000d4720000d6720000d8720000da720000dc720000de720000e0720000e2720000e4720000e6720000e8720000ea720000ec720000ee720000f0720000f2720000f4720000f8720000fa720000fc720000fe72000000730000027300000473000006730000087300000a7300000c7300000e730000107300001273000014730000167300001a7300001c7300001e730000207300002273000024730000267300002c730000767300008e73000094730000e67300005877000058790000e67c0000047d00000c7d0000de820000e8820000f482000040890000
|
||||
m_ExpandedIDs: ffffffff0000000092720000487400004a7400004c7400004e74000050740000527400005474000056740000587400005a7400005c7400005e74000060740000627400006474000066740000687400006a7400006c7400006e74000070740000727400007474000076740000787400007a7400007c7400007e74000080740000827400008474000086740000887400008a7400008c7400008e74000090740000927400009474000096740000987400009a7400009c7400009e740000a0740000a2740000a4740000a6740000a8740000aa740000ac740000ae740000b0740000b2740000b4740000b6740000b8740000ba740000bc740000be740000c0740000c2740000c4740000c6740000c8740000ca740000cc740000ce740000d0740000d2740000d4740000d6740000d8740000da740000dc740000de740000e0740000e2740000e4740000e6740000e8740000ea740000ec740000ee740000f0740000f2740000f4740000f6740000f8740000fa740000fc740000fe74000000750000027500000475000006750000087500000a7500000c7500000e75000010750000127500001475000016750000187500001a7500001c7500001e75000020750000227500002475000026750000287500002a7500002c7500002e75000030750000327500003475000036750000387500003a7500003c7500003e75000040750000427500004475000046750000487500004a7500004c7500004e75000050750000527500005475000056750000587500005a7500005c7500005e75000060750000627500006475000066750000687500006a7500006c7500006e75000070750000727500007475000076750000787500007a7500007c7500007e75000080750000827500008475000086750000887500008a7500008c7500008e75000090750000927500009475000096750000987500009a7500009c7500009e750000a0750000a2750000a4750000a6750000a8750000aa750000ac750000ae750000b0750000b2750000b4750000b6750000b8750000ba750000bc750000be750000c0750000c2750000c4750000c6750000c8750000ca750000cc750000ce750000d0750000d2750000d4750000d6750000d8750000da750000dc750000de750000e0750000e2750000e4750000e6750000e8750000ea750000ec750000ee750000f0750000f2750000f4750000f6750000f8750000fc750000027600000476000006760000087600000a7600000c7600000e7600001076000012760000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
m_OriginalName:
|
||||
m_Name: keyboard
|
||||
m_OriginalName: keyboard
|
||||
m_EditFieldRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
m_UserData: 0
|
||||
m_UserData: 27866
|
||||
m_IsWaitingForDelay: 0
|
||||
m_IsRenaming: 0
|
||||
m_OriginalEventType: 11
|
||||
m_OriginalEventType: 0
|
||||
m_IsRenamingFilename: 1
|
||||
m_ClientGUIView: {fileID: 13}
|
||||
m_SearchString:
|
||||
@ -1233,8 +1233,8 @@ MonoBehaviour:
|
||||
m_Icon: {fileID: 0}
|
||||
m_ResourceFile:
|
||||
m_ListAreaState:
|
||||
m_SelectedInstanceIDs: 1cb1ffff
|
||||
m_LastClickedInstanceID: -20196
|
||||
m_SelectedInstanceIDs: 8cfaffff
|
||||
m_LastClickedInstanceID: -1396
|
||||
m_HadKeyboardFocusLastEvent: 0
|
||||
m_ExpandedInstanceIDs: 0c750000f2d60000
|
||||
m_RenameOverlay:
|
||||
@ -1279,9 +1279,9 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 1303
|
||||
x: 1347
|
||||
y: 0
|
||||
width: 617
|
||||
width: 573
|
||||
height: 947
|
||||
m_MinSize: {x: 275, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
@ -1310,9 +1310,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 1303
|
||||
y: 73
|
||||
width: 616
|
||||
x: 1348
|
||||
y: 19
|
||||
width: 572
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1327,11 +1327,11 @@ MonoBehaviour:
|
||||
m_ObjectsLockedBeforeSerialization: []
|
||||
m_InstanceIDsLockedBeforeSerialization:
|
||||
m_PreviewResizer:
|
||||
m_CachedPref: 290
|
||||
m_CachedPref: 151
|
||||
m_ControlHash: 1412526313
|
||||
m_PrefName: Preview_InspectorPreview
|
||||
m_LastInspectedObjectInstanceID: -1
|
||||
m_LastVerticalScrollValue: 540
|
||||
m_LastVerticalScrollValue: 0
|
||||
m_GlobalObjectId:
|
||||
m_InspectorMode: 0
|
||||
m_LockTracker:
|
||||
|
||||
@ -121,7 +121,7 @@ MonoBehaviour:
|
||||
m_MinSize: {x: 400, y: 100}
|
||||
m_MaxSize: {x: 32384, y: 16192}
|
||||
vertical: 0
|
||||
controlID: 46181
|
||||
controlID: 155
|
||||
draggingID: 0
|
||||
--- !u!114 &6
|
||||
MonoBehaviour:
|
||||
@ -142,12 +142,12 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 383
|
||||
width: 468
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
vertical: 1
|
||||
controlID: 46011
|
||||
controlID: 25
|
||||
draggingID: 0
|
||||
--- !u!114 &7
|
||||
MonoBehaviour:
|
||||
@ -166,10 +166,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 383
|
||||
width: 468
|
||||
height: 363
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 201, y: 221}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 16}
|
||||
m_Panes:
|
||||
- {fileID: 15}
|
||||
@ -193,10 +193,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 363
|
||||
width: 383
|
||||
width: 468
|
||||
height: 584
|
||||
m_MinSize: {x: 50, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 51, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 14}
|
||||
m_Panes:
|
||||
- {fileID: 14}
|
||||
@ -219,14 +219,14 @@ MonoBehaviour:
|
||||
- {fileID: 11}
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 383
|
||||
x: 468
|
||||
y: 0
|
||||
width: 213
|
||||
width: 288
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
vertical: 1
|
||||
controlID: 46071
|
||||
controlID: 69
|
||||
draggingID: 0
|
||||
--- !u!114 &10
|
||||
MonoBehaviour:
|
||||
@ -245,10 +245,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 213
|
||||
width: 288
|
||||
height: 601
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 202, y: 221}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 17}
|
||||
m_Panes:
|
||||
- {fileID: 17}
|
||||
@ -271,10 +271,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 601
|
||||
width: 213
|
||||
width: 288
|
||||
height: 346
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 102, y: 121}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 18}
|
||||
m_Panes:
|
||||
- {fileID: 18}
|
||||
@ -295,9 +295,9 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 596
|
||||
x: 756
|
||||
y: 0
|
||||
width: 359
|
||||
width: 183
|
||||
height: 947
|
||||
m_MinSize: {x: 232, y: 271}
|
||||
m_MaxSize: {x: 10002, y: 10021}
|
||||
@ -321,12 +321,12 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 955
|
||||
x: 939
|
||||
y: 0
|
||||
width: 965
|
||||
width: 981
|
||||
height: 947
|
||||
m_MinSize: {x: 275, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 276, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 20}
|
||||
m_Panes:
|
||||
- {fileID: 20}
|
||||
@ -354,7 +354,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 436
|
||||
width: 382
|
||||
width: 467
|
||||
height: 563
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -408,10 +408,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 21
|
||||
width: 382
|
||||
width: 467
|
||||
height: 542
|
||||
m_Scale: {x: 0.19895834, y: 0.19895834}
|
||||
m_Translation: {x: 191, y: 271}
|
||||
m_Scale: {x: 0.24322917, y: 0.24322918}
|
||||
m_Translation: {x: 233.5, y: 271}
|
||||
m_MarginLeft: 0
|
||||
m_MarginRight: 0
|
||||
m_MarginTop: 0
|
||||
@ -419,12 +419,12 @@ MonoBehaviour:
|
||||
m_LastShownAreaInsideMargins:
|
||||
serializedVersion: 2
|
||||
x: -960
|
||||
y: -1362.0942
|
||||
y: -1114.1755
|
||||
width: 1920
|
||||
height: 2724.1885
|
||||
height: 2228.351
|
||||
m_MinimalGUI: 1
|
||||
m_defaultScale: 0.19895834
|
||||
m_LastWindowPixelSize: {x: 382, y: 563}
|
||||
m_defaultScale: 0.24322917
|
||||
m_LastWindowPixelSize: {x: 467, y: 563}
|
||||
m_ClearInEditMode: 1
|
||||
m_NoCameraWarning: 1
|
||||
m_LowResolutionForAspectRatios: 01000000000000000000
|
||||
@ -522,7 +522,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 73
|
||||
width: 382
|
||||
width: 467
|
||||
height: 342
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1163,9 +1163,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 1
|
||||
y: 19
|
||||
width: 211
|
||||
x: 468
|
||||
y: 73
|
||||
width: 286
|
||||
height: 580
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1180,23 +1180,23 @@ MonoBehaviour:
|
||||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: 5afffeff
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: 20b1ffff34b1ffff1cfbffffc86d00009e6e0000
|
||||
m_ExpandedIDs: b0faffff006e0000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name: Dropdown
|
||||
m_OriginalName: Dropdown
|
||||
m_Name:
|
||||
m_OriginalName:
|
||||
m_EditFieldRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
m_UserData: 28280
|
||||
m_UserData: 0
|
||||
m_IsWaitingForDelay: 0
|
||||
m_IsRenaming: 0
|
||||
m_OriginalEventType: 0
|
||||
m_OriginalEventType: 11
|
||||
m_IsRenamingFilename: 0
|
||||
m_ClientGUIView: {fileID: 10}
|
||||
m_SearchString:
|
||||
@ -1226,9 +1226,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 1
|
||||
y: 620
|
||||
width: 211
|
||||
x: 468
|
||||
y: 674
|
||||
width: 286
|
||||
height: 325
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1260,9 +1260,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 596
|
||||
x: 756
|
||||
y: 73
|
||||
width: 357
|
||||
width: 181
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1301,7 +1301,7 @@ MonoBehaviour:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: e48c0000
|
||||
m_LastClickedID: 36068
|
||||
m_ExpandedIDs: ffffffff0000000070710000727100007471000076710000787100007a7100007c7100007e71000080710000827100008471000086710000887100008a7100008c7100008e71000090710000927100009471000096710000987100009a7100009c7100009e710000a0710000a2710000a4710000a6710000a8710000aa710000ac710000ae710000b0710000b2710000b4710000b6710000b8710000ba710000bc710000be710000c0710000c2710000c4710000c6710000c8710000ca710000cc710000ce710000d0710000d2710000d4710000d6710000d8710000da710000dc710000de710000e0710000e2710000e4710000e6710000e8710000ea710000ec710000ee710000f0710000f2710000f4710000f6710000f8710000fa710000fc710000fe71000000720000027200000472000006720000087200000a7200000c7200000e72000010720000127200001472000016720000187200001a7200001c7200001e72000020720000227200002472000026720000287200002a7200002c7200002e72000030720000327200003472000036720000387200003a7200003c7200003e72000040720000427200004472000046720000487200004a7200004c7200004e72000050720000527200005472000056720000587200005a7200005c7200005e72000060720000627200006472000066720000687200006a7200006c7200006e72000070720000727200007472000076720000787200007a7200007c7200007e72000080720000827200008472000086720000887200008a7200008c7200008e72000090720000927200009472000096720000987200009a7200009c7200009e720000a0720000a2720000a4720000a6720000a8720000aa720000ac720000ae720000b0720000b2720000b4720000b6720000b8720000ba720000bc720000be720000c0720000c2720000c4720000c6720000c8720000ca720000cc720000ce720000d2720000d4720000d6720000d8720000da720000dc720000de720000e0720000e2720000e4720000e6720000e8720000ea720000ec720000ee720000f0720000f2720000f4720000f8720000fa720000fc720000fe72000000730000027300000473000006730000087300000a7300000c7300000e730000107300001273000014730000167300001a7300001c7300001e730000207300002273000024730000267300002c730000767300008e73000094730000e67300005877000058790000e67c0000047d00000c7d0000de820000e8820000f482000040890000
|
||||
m_ExpandedIDs: 00000000e86f0000987200004e74000050740000527400005474000056740000587400005a7400005c7400005e74000060740000627400006474000066740000687400006a7400006c7400006e74000070740000727400007474000076740000787400007a7400007c7400007e74000080740000827400008474000086740000887400008a7400008c7400008e74000090740000927400009474000096740000987400009a7400009c7400009e740000a0740000a2740000a4740000a6740000a8740000aa740000ac740000ae740000b0740000b2740000b4740000b6740000b8740000ba740000bc740000be740000c0740000c2740000c4740000c6740000c8740000ca740000cc740000ce740000d0740000d2740000d4740000d6740000d8740000da740000dc740000de740000e0740000e2740000e4740000e6740000e8740000ea740000ec740000ee740000f0740000f2740000f4740000f6740000f8740000fa740000fc740000fe74000000750000027500000475000006750000087500000a7500000c7500000e75000010750000127500001475000016750000187500001a7500001c7500001e75000020750000227500002475000026750000287500002a7500002c7500002e75000030750000327500003475000036750000387500003a7500003c7500003e75000040750000427500004475000046750000487500004a7500004c7500004e75000050750000527500005475000056750000587500005a7500005c7500005e75000060750000627500006475000066750000687500006a7500006c7500006e75000070750000727500007475000076750000787500007a7500007c7500007e75000080750000827500008475000086750000887500008a7500008c7500008e75000090750000927500009475000096750000987500009a7500009c7500009e750000a0750000a2750000a4750000a6750000a8750000aa750000ac750000ae750000b0750000b2750000b4750000b6750000b8750000ba750000bc750000be750000c0750000c2750000c4750000c6750000c8750000ca750000cc750000ce750000d0750000d2750000d4750000d6750000d8750000da750000dc750000de750000e0750000e2750000e4750000e6750000e8750000ea750000ec750000ee750000f0750000f2750000f4750000f6750000f8750000fa750000fc750000fe75000000760000027600000476000006760000087600000a7600000c7600000e7600001076000012760000147600001676000018760000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@ -1329,21 +1329,21 @@ MonoBehaviour:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: ffffffff0000000070710000727100007471000076710000787100007a7100007c7100007e71000080710000827100008471000086710000887100008a7100008c7100008e71000090710000927100009471000096710000987100009a7100009c7100009e710000a0710000a2710000a4710000a6710000a8710000aa710000ac710000ae710000b0710000b2710000b4710000b6710000b8710000ba710000bc710000be710000c0710000c2710000c4710000c6710000c8710000ca710000cc710000ce710000d0710000d2710000d4710000d6710000d8710000da710000dc710000de710000e0710000e2710000e4710000e6710000e8710000ea710000ec710000ee710000f0710000f2710000f4710000f6710000f8710000fa710000fc710000fe71000000720000027200000472000006720000087200000a7200000c7200000e72000010720000127200001472000016720000187200001a7200001c7200001e72000020720000227200002472000026720000287200002a7200002c7200002e72000030720000327200003472000036720000387200003a7200003c7200003e72000040720000427200004472000046720000487200004a7200004c7200004e72000050720000527200005472000056720000587200005a7200005c7200005e72000060720000627200006472000066720000687200006a7200006c7200006e72000070720000727200007472000076720000787200007a7200007c7200007e72000080720000827200008472000086720000887200008a7200008c7200008e72000090720000927200009472000096720000987200009a7200009c7200009e720000a0720000a2720000a4720000a6720000a8720000aa720000ac720000ae720000b0720000b2720000b4720000b6720000b8720000ba720000bc720000be720000c0720000c2720000c4720000c6720000c8720000ca720000cc720000ce720000d2720000d4720000d6720000d8720000da720000dc720000de720000e0720000e2720000e4720000e6720000e8720000ea720000ec720000ee720000f0720000f2720000f4720000f8720000fa720000fc720000fe72000000730000027300000473000006730000087300000a7300000c7300000e730000107300001273000014730000167300001a7300001c7300001e730000207300002273000024730000267300002a7300002c7300007c7300008e73000094730000e6730000587700005e77000058790000e67c0000047d00000c7d0000e88200000083000040890000289b0000
|
||||
m_ExpandedIDs: ffffffff00000000e86f0000987200004e74000050740000527400005474000056740000587400005a7400005c7400005e74000060740000627400006474000066740000687400006a7400006c7400006e74000070740000727400007474000076740000787400007a7400007c7400007e74000080740000827400008474000086740000887400008a7400008c7400008e74000090740000927400009474000096740000987400009a7400009c7400009e740000a0740000a2740000a4740000a6740000a8740000aa740000ac740000ae740000b0740000b2740000b4740000b6740000b8740000ba740000bc740000be740000c0740000c2740000c4740000c6740000c8740000ca740000cc740000ce740000d0740000d2740000d4740000d6740000d8740000da740000dc740000de740000e0740000e2740000e4740000e6740000e8740000ea740000ec740000ee740000f0740000f2740000f4740000f6740000f8740000fa740000fc740000fe74000000750000027500000475000006750000087500000a7500000c7500000e75000010750000127500001475000016750000187500001a7500001c7500001e75000020750000227500002475000026750000287500002a7500002c7500002e75000030750000327500003475000036750000387500003a7500003c7500003e75000040750000427500004475000046750000487500004a7500004c7500004e75000050750000527500005475000056750000587500005a7500005c7500005e75000060750000627500006475000066750000687500006a7500006c7500006e75000070750000727500007475000076750000787500007a7500007c7500007e75000080750000827500008475000086750000887500008a7500008c7500008e75000090750000927500009475000096750000987500009a7500009c7500009e750000a0750000a2750000a4750000a6750000a8750000aa750000ac750000ae750000b0750000b2750000b4750000b6750000b8750000ba750000bc750000be750000c0750000c2750000c4750000c6750000c8750000ca750000cc750000ce750000d0750000d2750000d4750000d6750000d8750000da750000dc750000de750000e0750000e2750000e4750000e6750000e8750000ea750000ec750000ee750000f0750000f2750000f4750000f6750000f8750000fa750000fc750000fe75000000760000027600000476000006760000087600000a7600000c7600000e7600001076000012760000147600001676000018760000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name: InputActionDebug
|
||||
m_OriginalName: InputActionDebug
|
||||
m_Name:
|
||||
m_OriginalName:
|
||||
m_EditFieldRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
m_UserData: 56070
|
||||
m_UserData: 0
|
||||
m_IsWaitingForDelay: 0
|
||||
m_IsRenaming: 0
|
||||
m_OriginalEventType: 0
|
||||
m_OriginalEventType: 11
|
||||
m_IsRenamingFilename: 1
|
||||
m_ClientGUIView: {fileID: 12}
|
||||
m_SearchString:
|
||||
@ -1405,9 +1405,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 955
|
||||
x: 939
|
||||
y: 73
|
||||
width: 964
|
||||
width: 980
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user