feat: Addressables rules/sync tools, UI fixes, AddressKeys update

- Add AddressableRules.cs: single source of truth for prefix->group and prefix->label rules
- Add AddressableRuleSyncWindow.cs: scan/fix/export-CSV tool (BaseGames > Addressables > Rule Sync)
- AddressableBatchTool.cs: delegate DeriveGroupName to AddressableRules, remove duplicate PrefixGroupMap
- AddressKeys.cs: add Labels constants (Preload, Poolable, Enemy, BGM, SFX, Charms, Config, Weapon)
- Docs/Standards/AddressablesLabelSpec.md: new label naming & assignment spec
- Docs/Standards/AssetFolderSpec.md: update Addressables group strategy section
- SplashScreenController.cs: fix MainMenu loading flow
- BootFlowSetupWizard.cs / SceneScaffoldTools.cs: scene scaffold fixes
- PlayerInputActions: set UI/Point to Pass-Through type
- Persistent.unity: add BootSequencer to auto-load MainMenu on play
- EditorBuildSettings.asset: register scenes for build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-20 11:10:31 +08:00
parent 5fd981f5b9
commit c88d2d0549
46 changed files with 6099 additions and 2588 deletions

View File

@@ -17,8 +17,13 @@ MonoBehaviour:
m_SerializedData: [] m_SerializedData: []
m_GUID: bb063dcc2b7a95445ba989917306f188 m_GUID: bb063dcc2b7a95445ba989917306f188
m_SerializeEntries: m_SerializeEntries:
- m_GUID: 2a1ec0c1f9a64054f95911d1cda97f6e
m_Address: Assets/_Game/Scenes/Testings/MainMenu.unity
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 6372e5b8e07d7ae4eb37a184fc8e912d - m_GUID: 6372e5b8e07d7ae4eb37a184fc8e912d
m_Address: Scene_Persistent m_Address: Assets/_Game/Scenes/Persistent.unity
m_ReadOnly: 0 m_ReadOnly: 0
m_SerializedLabels: [] m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0 FlaggedDuringContentUpdateRestriction: 0

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_CheckpointRespawn
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eef5aef659932dd448be6d91119082e6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 23dad55c2f7bcc54a92ed61cc6f27c5b, type: 3}
m_Name: EVT_MaxHPContainerPickedUp
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 25684d2fcc1c0664f9bd00c8f83d1473
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aea19505e2b46be4c8f9e1002dccc739
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_LoadingComplete
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1e4580d266c4bd44c8b25a70d26608d3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62f2d5b0575789048b6badd7d1608db3, type: 3}
m_Name: EVT_LoadingProgressUpdated
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2d366d52ee6a8214c8cd94d14e9ccd15
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_LoadingStarted
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 78de6bbfc7741ad47ad568ba0b65fde0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e350e72ad553c7a4c821a83692256f8b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ce6e33f4353535944a0d2573df0a08d4, type: 3}
m_Name: EVT_SlotConfirmed
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1c277e56e36d35b4393889527ad3306d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ddb591133c2948746a3afcd1010dc494
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_SplashComplete
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cba99b7e6819cd045b1869258dcef1e6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_SplashStartRequest
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d769382aa82a14d498706776dfb4091e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07c5881d0d5ca3c42949a79f40939c3e, type: 3}
m_Name: EVT_CheckpointReached
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 172e9bc777b1b4b4b99f47e43cbaedb1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 23dad55c2f7bcc54a92ed61cc6f27c5b, type: 3}
m_Name: EVT_DoorOpened
m_EditorClassIdentifier:
description:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e07e660aec45fb40a296a27bb0b8fbd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2a1ec0c1f9a64054f95911d1cda97f6e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -183,7 +183,7 @@ Camera:
height: 1 height: 1
near clip plane: 0.1 near clip plane: 0.1
far clip plane: 5000 far clip plane: 5000
field of view: 10 field of view: 40
orthographic: 0 orthographic: 0
orthographic size: 10 orthographic size: 10
m_Depth: -1 m_Depth: -1
@@ -210,7 +210,7 @@ Transform:
m_GameObject: {fileID: 265623115} m_GameObject: {fileID: 265623115}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.19243693, y: -1.6213, z: -64} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []

View File

@@ -57,14 +57,29 @@ namespace BaseGames.Core.Assets
/// Addressable 标签常量(用于批量加载)。 /// Addressable 标签常量(用于批量加载)。
/// 注意:这里是标签名称而非资产地址,不会被 AddressKeyValidator 校验。 /// 注意:这里是标签名称而非资产地址,不会被 AddressKeyValidator 校验。
/// </summary> /// </summary>
/// <summary>
/// Addressable Label 常量(用于批量加载与预热)。
/// 代码中引用 Label 时必须使用此处的常量,禁止硬编码字符串。
/// 完整说明见 Docs/Standards/AddressablesLabelSpec.md。
/// </summary>
public static class Labels public static class Labels
{ {
public const string Enemy = "Enemy"; /// <summary>游戏启动时通过 DownloadDependenciesAsync 预热下载依赖BootSequencer 使用)。</summary>
public const string Poolable = "Poolable";
public const string BGM = "BGM";
public const string Charms = "Charms";
/// <summary>游戏启动时预热下载的资产标签BootSequencer 使用)。</summary>
public const string Preload = "Preload"; public const string Preload = "Preload";
/// <summary>纳入 GlobalObjectPool 对象池管理的 PrefabVFX、投射物、收集物等。</summary>
public const string Poolable = "Poolable";
/// <summary>所有敌人顶级 Prefab用于区域 Spawner 批量加载。</summary>
public const string Enemy = "Enemy";
/// <summary>背景音乐 AudioClip / FMOD bank 引用 SOAudioManager 批量建立 BGM 索引。</summary>
public const string BGM = "BGM";
/// <summary>音效 AudioClip / SFX 配置 SOAudioManager 批量建立 SFX 索引。</summary>
public const string SFX = "SFX";
/// <summary>所有护身符配置 SOCHM_*.assetEquipmentManager 批量加载护身符列表。</summary>
public const string Charms = "Charms";
/// <summary>运行时动态加载的配置类 SOInspector 直接引用的 SO 不加此标签)。</summary>
public const string Config = "Config";
/// <summary>所有武器 PrefabWPN_*.prefab玩家换形态时批量加载武器列表。</summary>
public const string Weapon = "Weapon";
} }
} }
} }

View File

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

View File

@@ -40,18 +40,7 @@ namespace BaseGames.Editor
private bool _autoGroupByPrefix = true; // 按 Key 前缀自动选/建分组 private bool _autoGroupByPrefix = true; // 按 Key 前缀自动选/建分组
// Key 前缀 → 分组名称映射Tab ① 自动分组用) // Key 前缀 → 分组名称映射Tab ① 自动分组用)
private static readonly (string Prefix, string GroupName)[] PrefixGroupMap = // 规范数据统一来自 AddressableRules此处不再声明本地副本。
{
("Scene_", "Scenes"),
("PLY_", "Player"),
("ENM_", "Enemies"),
("PROJ_", "Projectiles"),
("VFX_", "VFX"),
("UI_", "UI"),
("COL_", "Collectibles"),
("WPN_", "Weapons"),
("Config/", "Config"),
};
// Tab ② // Tab ②
private DefaultAsset _folderAsset; private DefaultAsset _folderAsset;
@@ -743,12 +732,7 @@ namespace BaseGames.Editor
/// <summary>根据 AddressKey 前缀返回建议分组名,未匹配时返回 null回退到手动选定分组。</summary> /// <summary>根据 AddressKey 前缀返回建议分组名,未匹配时返回 null回退到手动选定分组。</summary>
private static string DeriveGroupName(string key) private static string DeriveGroupName(string key)
{ => AddressableRules.GetExpectedGroup(key);
foreach (var (prefix, groupName) in PrefixGroupMap)
if (key.StartsWith(prefix, StringComparison.Ordinal))
return groupName;
return null;
}
private static bool ExactNameMatch(string assetPath, string searchName) private static bool ExactNameMatch(string assetPath, string searchName)
{ {

View File

@@ -0,0 +1,486 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEditor.AddressableAssets;
using UnityEditor.AddressableAssets.Settings;
using UnityEngine;
namespace BaseGames.Editor
{
/// <summary>
/// Addressable 规则同步窗口。
///
/// 功能:
/// 1. 扫描所有已注册的 Addressable 资产
/// 2. 根据 <see cref="AddressableRules"/> 中的规则计算期望分组与期望标签
/// 3. 对比实际值,显示所有不符合规范的条目(分组错误 / 标签缺失 / 标签多余)
/// 4. 一键自动修复全部问题
/// 5. 导出 CSV 报告供存档或 Code Review
///
/// 菜单BaseGames → Addressables → Rule Sync
/// </summary>
public class AddressableRuleSyncWindow : EditorWindow
{
// ── 内部数据结构 ───────────────────────────────────────────────────────
private enum IssueKind { None, WrongGroup, MissingLabel, ExtraLabel }
private class EntryReport
{
public string Address;
public string AssetPath;
public string CurrentGroup;
public string ExpectedGroup; // null = 规则未覆盖,维持现状
public string[] CurrentLabels;
public string[] ExpectedLabels;
public string[] MissingLabels; // 应有但没有
public string[] ExtraLabels; // 有但不应有
public bool GroupOk => ExpectedGroup == null || CurrentGroup == ExpectedGroup;
public bool LabelsOk => MissingLabels.Length == 0 && ExtraLabels.Length == 0;
public bool IsOk => GroupOk && LabelsOk;
}
// ── 状态 ──────────────────────────────────────────────────────────────
private List<EntryReport> _reports = new();
private Vector2 _scrollPos;
private bool _showOk = false;
private bool _scanned = false;
private string _searchFilter = "";
// ── 样式(惰性初始化)────────────────────────────────────────────────
private GUIStyle _okStyle;
private GUIStyle _warnStyle;
private GUIStyle _errorStyle;
private GUIStyle _boldStyle;
private GUIStyle _rowEven;
private GUIStyle _rowOdd;
private bool _stylesReady;
// ── 颜色 ─────────────────────────────────────────────────────────────
private static readonly Color ColOk = new(0.20f, 0.78f, 0.35f, 1f);
private static readonly Color ColWarn = new(0.95f, 0.75f, 0.10f, 1f);
private static readonly Color ColError = new(0.90f, 0.25f, 0.20f, 1f);
private static readonly Color ColRowEven = new(0.22f, 0.22f, 0.22f, 0.4f);
// ── 菜单入口 ──────────────────────────────────────────────────────────
[MenuItem("BaseGames/Addressables/Rule Sync", priority = 110)]
public static void OpenWindow()
{
var win = GetWindow<AddressableRuleSyncWindow>("Addressable Rule Sync");
win.minSize = new Vector2(900, 520);
win.Show();
}
// ── GUI ───────────────────────────────────────────────────────────────
private void OnGUI()
{
EnsureStyles();
if (AddressableAssetSettingsDefaultObject.Settings == null)
{
EditorGUILayout.HelpBox(
"Addressable Settings 未初始化。\n" +
"请先执行 Window → Asset Management → Addressables → Groups → Create Addressables Settings。",
MessageType.Error);
return;
}
DrawToolbar();
DrawStats();
DrawTable();
DrawFooter();
}
// ── 工具栏 ────────────────────────────────────────────────────────────
private void DrawToolbar()
{
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
{
if (GUILayout.Button("扫描", EditorStyles.toolbarButton, GUILayout.Width(80)))
Scan();
GUILayout.Space(8);
_showOk = GUILayout.Toggle(_showOk, "显示正常项", EditorStyles.toolbarButton, GUILayout.Width(80));
GUILayout.Space(8);
EditorGUILayout.LabelField("搜索:", GUILayout.Width(42));
_searchFilter = EditorGUILayout.TextField(_searchFilter, EditorStyles.toolbarSearchField,
GUILayout.Width(200));
GUILayout.FlexibleSpace();
GUI.enabled = _scanned && _reports.Any(r => !r.IsOk);
if (GUILayout.Button("✦ 修复所有问题", EditorStyles.toolbarButton, GUILayout.Width(120)))
FixAll();
GUI.enabled = _scanned;
if (GUILayout.Button("导出 CSV", EditorStyles.toolbarButton, GUILayout.Width(80)))
ExportCsv();
GUI.enabled = true;
}
}
// ── 统计行 ────────────────────────────────────────────────────────────
private void DrawStats()
{
if (!_scanned) return;
int total = _reports.Count;
int ok = _reports.Count(r => r.IsOk);
int issues = total - ok;
int wrongGrp = _reports.Count(r => !r.GroupOk);
int misLabel = _reports.Count(r => r.MissingLabels.Length > 0);
int extLabel = _reports.Count(r => r.ExtraLabels.Length > 0);
EditorGUILayout.Space(2);
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Label($"共 {total} 条目", EditorStyles.miniLabel);
GUILayout.Space(12);
DrawColoredLabel($"✅ 正常 {ok}", ColOk);
GUILayout.Space(12);
DrawColoredLabel($"⚠ 问题 {issues}", issues > 0 ? ColWarn : ColOk);
GUILayout.Space(20);
GUILayout.Label($"分组错误 {wrongGrp} | 标签缺失 {misLabel} | 标签多余 {extLabel}",
EditorStyles.miniLabel);
GUILayout.FlexibleSpace();
}
EditorGUILayout.Space(2);
}
// ── 主表格 ────────────────────────────────────────────────────────────
private void DrawTable()
{
// 表头
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
{
GUILayout.Label("Address", _boldStyle, GUILayout.Width(200));
GUILayout.Label("当前分组", _boldStyle, GUILayout.Width(130));
GUILayout.Label("期望分组", _boldStyle, GUILayout.Width(130));
GUILayout.Label("缺失标签", _boldStyle, GUILayout.Width(140));
GUILayout.Label("多余标签", _boldStyle, GUILayout.Width(120));
GUILayout.Label("状态", _boldStyle, GUILayout.Width(80));
}
_scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, GUILayout.ExpandHeight(true));
if (!_scanned)
{
EditorGUILayout.HelpBox("点击「扫描」按钮开始分析已注册的 Addressable 资产。", MessageType.Info);
}
else
{
var display = _reports
.Where(r => _showOk || !r.IsOk)
.Where(r => string.IsNullOrEmpty(_searchFilter)
|| r.Address.IndexOf(_searchFilter, StringComparison.OrdinalIgnoreCase) >= 0)
.ToList();
if (display.Count == 0)
{
EditorGUILayout.HelpBox(
_showOk ? "没有匹配搜索条件的条目。" : "✅ 所有资产均符合规范!",
MessageType.Info);
}
for (int i = 0; i < display.Count; i++)
DrawRow(display[i], i);
}
EditorGUILayout.EndScrollView();
}
private void DrawRow(EntryReport r, int idx)
{
var bg = idx % 2 == 0 ? _rowEven : GUIStyle.none;
using (new EditorGUILayout.HorizontalScope(bg, GUILayout.Height(20)))
{
// Address点击可 Ping
if (GUILayout.Button(r.Address, EditorStyles.linkLabel, GUILayout.Width(200)))
PingAsset(r.AssetPath);
// 当前分组
var grpColor = r.GroupOk ? ColOk : ColError;
DrawColoredLabel(r.CurrentGroup ?? "—", grpColor, GUILayout.Width(130));
// 期望分组
var expGrpText = r.ExpectedGroup ?? "(规则未覆盖)";
var expGrpColor = r.GroupOk ? ColOk : ColWarn;
DrawColoredLabel(expGrpText, expGrpColor, GUILayout.Width(130));
// 缺失标签
var missingText = r.MissingLabels.Length > 0 ? string.Join(", ", r.MissingLabels) : "—";
DrawColoredLabel(missingText, r.MissingLabels.Length > 0 ? ColError : ColOk, GUILayout.Width(140));
// 多余标签
var extraText = r.ExtraLabels.Length > 0 ? string.Join(", ", r.ExtraLabels) : "—";
DrawColoredLabel(extraText, r.ExtraLabels.Length > 0 ? ColWarn : ColOk, GUILayout.Width(120));
// 状态 + 单条修复按钮
if (r.IsOk)
{
DrawColoredLabel("✅ 正常", ColOk, GUILayout.Width(80));
}
else
{
DrawColoredLabel("⚠ 需修复", ColWarn, GUILayout.Width(60));
if (GUILayout.Button("修复", EditorStyles.miniButton, GUILayout.Width(40)))
FixEntry(r);
}
}
}
// ── 底栏 ──────────────────────────────────────────────────────────────
private void DrawFooter()
{
EditorGUILayout.Space(4);
EditorGUILayout.HelpBox(
"规则来源Docs/Standards/AddressablesLabelSpec.md §3 分组规则AssetFolderSpec.md §8.1\n" +
"「修复所有问题」仅修改已注册资产的分组/标签,不注册新资产(请用 Addressable Batch Tool。",
MessageType.None);
}
// ── 扫描逻辑 ──────────────────────────────────────────────────────────
private void Scan()
{
_reports.Clear();
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return;
// 收集所有全局标签供"多余标签"判断
var allKnownLabels = new HashSet<string>(settings.GetLabels(), StringComparer.Ordinal);
foreach (var group in settings.groups)
{
if (group == null) continue;
foreach (var entry in group.entries)
{
if (entry == null) continue;
var address = entry.address;
var expectedGroup = AddressableRules.GetExpectedGroup(address);
var expectedLbls = AddressableRules.GetExpectedLabels(address);
var currentLbls = entry.labels.ToArray();
var missing = expectedLbls.Except(currentLbls, StringComparer.Ordinal).ToArray();
var extra = currentLbls.Except(expectedLbls, StringComparer.Ordinal).ToArray();
_reports.Add(new EntryReport
{
Address = address,
AssetPath = entry.AssetPath,
CurrentGroup = group.name,
ExpectedGroup = expectedGroup,
CurrentLabels = currentLbls,
ExpectedLabels = expectedLbls,
MissingLabels = missing,
ExtraLabels = extra,
});
}
}
// 问题项排前面,正常项排后面;同类按 Address 字母序
_reports = _reports
.OrderBy(r => r.IsOk)
.ThenBy(r => r.Address, StringComparer.Ordinal)
.ToList();
_scanned = true;
Repaint();
Debug.Log($"[AddressableRuleSync] 扫描完成:{_reports.Count} 个条目," +
$"{_reports.Count(r => !r.IsOk)} 个需要修复。");
}
// ── 修复逻辑 ──────────────────────────────────────────────────────────
private void FixAll()
{
var issues = _reports.Where(r => !r.IsOk).ToList();
if (issues.Count == 0) return;
int fixedCount = 0;
foreach (var r in issues)
{
if (FixEntry(r)) fixedCount++;
}
SaveSettings();
Scan(); // 修复后重新扫描以更新结果
Debug.Log($"[AddressableRuleSync] 修复完成:共处理 {fixedCount} 个条目。");
}
private bool FixEntry(EntryReport r)
{
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return false;
var entry = FindEntry(settings, r.Address);
if (entry == null)
{
Debug.LogWarning($"[AddressableRuleSync] 找不到条目:{r.Address}");
return false;
}
bool changed = false;
// 修复分组
if (!r.GroupOk && r.ExpectedGroup != null)
{
var targetGroup = GetOrCreateGroup(settings, r.ExpectedGroup);
if (targetGroup != null && entry.parentGroup != targetGroup)
{
settings.MoveEntry(entry, targetGroup, false, false);
r.CurrentGroup = r.ExpectedGroup;
changed = true;
}
}
// 添加缺失标签
foreach (var lbl in r.MissingLabels)
{
EnsureLabelExists(settings, lbl);
entry.SetLabel(lbl, true, true);
changed = true;
}
// 移除多余标签
foreach (var lbl in r.ExtraLabels)
{
entry.SetLabel(lbl, false, true);
changed = true;
}
return changed;
}
// ── 导出 CSV ──────────────────────────────────────────────────────────
private void ExportCsv()
{
if (_reports.Count == 0) return;
var path = EditorUtility.SaveFilePanel(
"导出 Addressable Rule 报告", "", "AddressableRuleReport.csv", "csv");
if (string.IsNullOrEmpty(path)) return;
var sb = new StringBuilder();
sb.AppendLine("Address,CurrentGroup,ExpectedGroup,GroupOk,MissingLabels,ExtraLabels,Status");
foreach (var r in _reports)
{
var status = r.IsOk ? "OK" : "ISSUE";
sb.AppendLine(
$"\"{r.Address}\"," +
$"\"{r.CurrentGroup}\"," +
$"\"{r.ExpectedGroup ?? "(uncovered)"}\"," +
$"{r.GroupOk}," +
$"\"{string.Join(";", r.MissingLabels)}\"," +
$"\"{string.Join(";", r.ExtraLabels)}\"," +
$"{status}");
}
File.WriteAllText(path, sb.ToString(), Encoding.UTF8);
Debug.Log($"[AddressableRuleSync] CSV 报告已导出:{path}");
}
// ── 辅助方法 ──────────────────────────────────────────────────────────
private static AddressableAssetEntry FindEntry(AddressableAssetSettings settings, string address)
{
foreach (var group in settings.groups)
{
if (group == null) continue;
foreach (var e in group.entries)
if (e != null && e.address == address) return e;
}
return null;
}
private static AddressableAssetGroup GetOrCreateGroup(AddressableAssetSettings settings, string groupName)
{
var existing = settings.groups.FirstOrDefault(g => g != null && g.name == groupName);
if (existing != null) return existing;
var template = settings.GroupTemplateObjects.FirstOrDefault()
as AddressableAssetGroupTemplate;
var newGroup = settings.CreateGroup(groupName, false, false, true,
template != null
? new List<AddressableAssetGroupSchema>(template.SchemaObjects)
: null);
if (newGroup != null)
Debug.Log($"[AddressableRuleSync] 已自动创建分组:{groupName}");
return newGroup ?? settings.DefaultGroup;
}
private static void EnsureLabelExists(AddressableAssetSettings settings, string label)
{
var labels = settings.GetLabels();
if (!labels.Contains(label))
{
settings.AddLabel(label, true);
Debug.Log($"[AddressableRuleSync] 已创建标签:{label}");
}
}
private static void SaveSettings()
{
AssetDatabase.SaveAssets();
AddressableAssetSettingsDefaultObject.Settings?.SetDirty(
AddressableAssetSettings.ModificationEvent.EntryModified, null, true);
}
private static void PingAsset(string assetPath)
{
if (string.IsNullOrEmpty(assetPath)) return;
var obj = AssetDatabase.LoadMainAssetAtPath(assetPath);
if (obj != null) EditorGUIUtility.PingObject(obj);
}
// ── 样式初始化 ────────────────────────────────────────────────────────
private void EnsureStyles()
{
if (_stylesReady) return;
_boldStyle = new GUIStyle(EditorStyles.boldLabel) { fontSize = 11 };
_okStyle = new GUIStyle(EditorStyles.miniLabel) { normal = { textColor = ColOk } };
_warnStyle = new GUIStyle(EditorStyles.miniLabel) { normal = { textColor = ColWarn } };
_errorStyle = new GUIStyle(EditorStyles.miniLabel) { normal = { textColor = ColError } };
_rowEven = new GUIStyle();
_rowEven.normal.background = MakeTexture(1, 1, ColRowEven);
_stylesReady = true;
}
private void DrawColoredLabel(string text, Color color, params GUILayoutOption[] options)
{
var prev = GUI.color;
GUI.color = color;
GUILayout.Label(text, EditorStyles.miniLabel, options);
GUI.color = prev;
}
private static Texture2D MakeTexture(int width, int height, Color color)
{
var tex = new Texture2D(width, height);
tex.SetPixel(0, 0, color);
tex.Apply();
return tex;
}
}
}

View File

@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using BaseGames.Core.Assets;
namespace BaseGames.Editor
{
/// <summary>
/// Addressable 分组与标签的权威规则数据。
/// 规范来源:<c>Docs/Standards/AddressablesLabelSpec.md §3</c> 与
/// <c>Docs/Standards/AssetFolderSpec.md §8</c>。
///
/// <see cref="AddressableBatchTool"/> 和 <see cref="AddressableRuleSyncWindow"/> 均引用此处,
/// 保证两个工具的分组/标签判断完全一致,修改规则时只需改这一处。
/// </summary>
public static class AddressableRules
{
// ── 前缀 → 分组名 ──────────────────────────────────────────────────────
// 规则:按 AssetFolderSpec §8.1 Group 划分策略。
// 顺序:更长/更具体的前缀必须排在更短/更泛化的前缀之前,否则短前缀会先匹配。
// 特殊Room_/Boss_ 地址的分组名在运行时动态计算,见 GetExpectedGroup()。
public static readonly (string Prefix, string Group)[] PrefixGroupMap =
{
("Scene_", "Scenes"),
("PLY_", "Player"),
("WPN_", "Player"), // 武器与玩家 Prefab 同组AssetFolderSpec §8.1
("ENM_", "Enemies"),
("PROJ_", "Projectiles"),
("VFX_", "VFX_Common"), // 通用特效组AssetFolderSpec §8.1
("UI_", "UI"),
("COL_", "Collectibles"),
("CHM_", "Config"), // 护身符 SO 归入 Config 组AddressablesLabelSpec §3.9
("Config/", "Config"),
("AUD_", "Audio_Music"),
};
// ── 精确地址 → 标签(优先级高于前缀规则)────────────────────────────────
private static readonly Dictionary<string, string[]> ExactLabelMap =
new(StringComparer.Ordinal)
{
// Scene_MainMenu 是唯一需要 Preload 的场景
{ AddressKeys.SceneMainMenu, new[] { AddressKeys.Labels.Preload } },
// Persistent 场景无需标签(随引擎启动,不通过 label 批量加载)
{ AddressKeys.ScenePersistent, Array.Empty<string>() },
// FloatingDamageText 是 Poolable + PreloadUI_ 前缀通常无 label此处例外
{ AddressKeys.PrefabUIFloatingDmgText, new[] { AddressKeys.Labels.Poolable, AddressKeys.Labels.Preload } },
// FootstepCatalog 是首帧必须可用的配置
{ AddressKeys.DataFootstepCatalog, new[] { AddressKeys.Labels.Config, AddressKeys.Labels.Preload } },
};
// ── 前缀 → 标签列表 ─────────────────────────────────────────────────────
// 顺序更具体的前缀AUD_BGM_在更泛化的前缀AUD_之前。
private static readonly (string Prefix, string[] Labels)[] PrefixLabelMap =
{
("AUD_BGM_", new[] { AddressKeys.Labels.BGM }),
("AUD_SFX_", new[] { AddressKeys.Labels.SFX }),
("AUD_", new[] { AddressKeys.Labels.BGM }), // 未细分音频默认归 BGM
("Scene_", Array.Empty<string>()), // 除 MainMenu 外场景无 label
("PLY_", new[] { AddressKeys.Labels.Preload }),
("WPN_", new[] { AddressKeys.Labels.Weapon, AddressKeys.Labels.Preload }),
("ENM_", new[] { AddressKeys.Labels.Enemy }),
("PROJ_", new[] { AddressKeys.Labels.Poolable, AddressKeys.Labels.Preload }),
("VFX_", new[] { AddressKeys.Labels.Poolable, AddressKeys.Labels.Preload }),
("UI_", Array.Empty<string>()), // 除 FloatingDamageText 外 UI 无默认 label
("COL_", new[] { AddressKeys.Labels.Poolable, AddressKeys.Labels.Preload }),
("CHM_", new[] { AddressKeys.Labels.Charms }),
("Config/", new[] { AddressKeys.Labels.Config }),
};
// ── 公开 API ───────────────────────────────────────────────────────────
/// <summary>
/// 根据 Addressable 地址字符串返回期望的分组名称。
/// <list type="bullet">
/// <item><c>Room_Forest_01</c> → <c>Room_Forest</c>(动态计算)</item>
/// <item><c>Boss_CaoZhi</c> → <c>Boss_CaoZhi</c>(动态计算)</item>
/// <item>无匹配前缀时返回 <c>null</c>(调用方可回退到 Default Group</item>
/// </list>
/// </summary>
public static string GetExpectedGroup(string address)
{
if (string.IsNullOrEmpty(address)) return null;
// Room_/Boss_ 的分组名在地址中动态编码
if (address.StartsWith("Room_", StringComparison.Ordinal))
{
var parts = address.Split('_');
return parts.Length >= 2 ? $"Room_{parts[1]}" : "Room_Unknown";
}
if (address.StartsWith("Boss_", StringComparison.Ordinal))
{
// Boss_CaoZhi → 整个地址即为分组名(与 AssetFolderSpec §8.1 一致)
return address;
}
foreach (var (prefix, group) in PrefixGroupMap)
{
if (address.StartsWith(prefix, StringComparison.Ordinal))
return group;
}
return null;
}
/// <summary>
/// 根据 Addressable 地址字符串返回期望的标签集合。
/// 精确地址匹配优先,其次前缀匹配,均无匹配时返回空数组。
/// </summary>
public static string[] GetExpectedLabels(string address)
{
if (string.IsNullOrEmpty(address)) return Array.Empty<string>();
if (ExactLabelMap.TryGetValue(address, out var exact))
return exact;
foreach (var (prefix, labels) in PrefixLabelMap)
{
if (address.StartsWith(prefix, StringComparison.Ordinal))
return labels;
}
return Array.Empty<string>();
}
}
}

View File

@@ -7,6 +7,7 @@ using BaseGames.Core;
using BaseGames.Core.Events; using BaseGames.Core.Events;
using BaseGames.UI; using BaseGames.UI;
using BaseGames.UI.MainMenu; using BaseGames.UI.MainMenu;
using BaseGames.UI.Menus;
using BaseGames.UI.Splash; using BaseGames.UI.Splash;
namespace BaseGames.Editor namespace BaseGames.Editor
@@ -27,8 +28,8 @@ namespace BaseGames.Editor
{ {
// ── 常量 ────────────────────────────────────────────────────────────── // ── 常量 ──────────────────────────────────────────────────────────────
private const string EventRoot = "Assets/_Game/Data/Events"; private const string EventRoot = "Assets/_Game/Data/Events";
private const string PersistentName = "Scene_Persistent"; private const string PersistentName = "Persistent";
private const string MainMenuName = "Scene_MainMenu"; private const string MainMenuName = "MainMenu";
// 启动流程所需的事件频道资产清单 (subfolder, assetName, SO type) // 启动流程所需的事件频道资产清单 (subfolder, assetName, SO type)
private static readonly (string folder, string name, System.Type type)[] BootChannels = private static readonly (string folder, string name, System.Type type)[] BootChannels =

View File

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

View File

@@ -202,8 +202,6 @@ namespace BaseGames.Editor
AssignReference(cameraStateController, "_brain", brain); AssignReference(cameraStateController, "_brain", brain);
AssignReference(cameraStateController, "_impulseSource", impulseSource); AssignReference(cameraStateController, "_impulseSource", impulseSource);
AssignReference(cameraStateController, "_lookSystem", lookSystem); AssignReference(cameraStateController, "_lookSystem", lookSystem);
AssignReference(cameraStateController, "_vcamA", vcamA);
AssignReference(cameraStateController, "_vcamB", vcamB);
AssignAsset(cameraStateController, "_onPlayerSpawned", report, true, "EVT_PlayerSpawned"); AssignAsset(cameraStateController, "_onPlayerSpawned", report, true, "EVT_PlayerSpawned");
AssignAsset(cameraStateController, "_lensConfig", report, false, "CAM_LensConfig", "LensConfig", "CameraLensConfig"); AssignAsset(cameraStateController, "_lensConfig", report, false, "CAM_LensConfig", "LensConfig", "CameraLensConfig");

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a81c593ef6b215e4c9752363738c131b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4714b32299804648acbfef71cf9ac81
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem;
using BaseGames.Core.Events; using BaseGames.Core.Events;
namespace BaseGames.UI.Splash namespace BaseGames.UI.Splash
@@ -35,6 +36,7 @@ namespace BaseGames.UI.Splash
[SerializeField] private VoidEventChannelSO _onSplashComplete; // Raise [SerializeField] private VoidEventChannelSO _onSplashComplete; // Raise
private bool _skipRequested; private bool _skipRequested;
private InputAction _anyButtonAction;
private readonly CompositeDisposable _subs = new(); private readonly CompositeDisposable _subs = new();
// ── 生命周期 ───────────────────────────────────────────────────────── // ── 生命周期 ─────────────────────────────────────────────────────────
@@ -45,10 +47,28 @@ namespace BaseGames.UI.Splash
SetAlpha(_splashRoot, 1f, blocksRaycasts: true); SetAlpha(_splashRoot, 1f, blocksRaycasts: true);
SetAlpha(_studioLogoGroup, 0f, blocksRaycasts: false); SetAlpha(_studioLogoGroup, 0f, blocksRaycasts: false);
SetAlpha(_gameTitleGroup, 0f, blocksRaycasts: false); SetAlpha(_gameTitleGroup, 0f, blocksRaycasts: false);
// 通配符绑定:捕获任意设备的任意按键/手柄键/触屏按压
_anyButtonAction = new InputAction(binding: "/*/<button>");
_anyButtonAction.performed += _ => _skipRequested = true;
} }
private void OnEnable() => _onSplashStartRequest?.Subscribe(OnStartRequested).AddTo(_subs); private void OnEnable()
private void OnDisable() => _subs.Clear(); {
_onSplashStartRequest?.Subscribe(OnStartRequested).AddTo(_subs);
_anyButtonAction.Enable();
}
private void OnDisable()
{
_subs.Clear();
_anyButtonAction.Disable();
}
private void OnDestroy()
{
_anyButtonAction.Dispose();
}
// ── 入口 ───────────────────────────────────────────────────────────── // ── 入口 ─────────────────────────────────────────────────────────────
@@ -94,14 +114,6 @@ namespace BaseGames.UI.Splash
gameObject.SetActive(false); gameObject.SetActive(false);
} }
// ── Unity 输入(任意按键跳过)────────────────────────────────────────
private void Update()
{
if (Input.anyKeyDown)
_skipRequested = true;
}
// ── 内部工具 ───────────────────────────────────────────────────────── // ── 内部工具 ─────────────────────────────────────────────────────────
private IEnumerator FadeGroup(CanvasGroup group, float from, float to, float duration) private IEnumerator FadeGroup(CanvasGroup group, float from, float to, float duration)

View File

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

View File

@@ -2,7 +2,7 @@
// <auto-generated> // <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.14.2 // version 1.14.2
// from Assets/Settings/PlayerInputActions.inputactions // from Assets/_Game/Settings/PlayerInputActions.inputactions
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@@ -16,7 +16,7 @@ using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.Utilities;
/// <summary> /// <summary>
/// Provides programmatic access to <see cref="InputActionAsset" />, <see cref="InputActionMap" />, <see cref="InputAction" /> and <see cref="InputControlScheme" /> instances defined in asset "Assets/Settings/PlayerInputActions.inputactions". /// Provides programmatic access to <see cref="InputActionAsset" />, <see cref="InputActionMap" />, <see cref="InputAction" /> and <see cref="InputControlScheme" /> instances defined in asset "Assets/_Game/Settings/PlayerInputActions.inputactions".
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified. /// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified.
@@ -231,7 +231,7 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
""name"": ""Pause"", ""name"": ""Pause"",
""type"": ""Button"", ""type"": ""Button"",
""id"": ""b15ae123-2d81-4473-a16f-dc7f1a9d3527"", ""id"": ""b15ae123-2d81-4473-a16f-dc7f1a9d3527"",
""expectedControlType"": ""Button"", ""expectedControlType"": """",
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
""initialStateCheck"": false ""initialStateCheck"": false
@@ -581,21 +581,30 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""UI"", ""name"": ""UI"",
""id"": ""905d74a5-6596-4177-8377-8a05d113b186"", ""id"": ""ba1e4240-82fc-40d3-ac98-5fe1f6ed88c0"",
""actions"": [ ""actions"": [
{ {
""name"": ""Navigate"", ""name"": ""Navigate"",
""type"": ""Value"", ""type"": ""PassThrough"",
""id"": ""16469da9-bfd0-4a21-a370-d89bdb682245"", ""id"": ""f8fcd154-d35c-40b0-b99a-0d1df5fa2e1f"",
""expectedControlType"": ""Vector2"", ""expectedControlType"": ""Vector2"",
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
""initialStateCheck"": true ""initialStateCheck"": false
},
{
""name"": ""Pause"",
""type"": ""Button"",
""id"": ""2d22c992-df5f-4d63-8a35-42a1464f7ff3"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}, },
{ {
""name"": ""Submit"", ""name"": ""Submit"",
""type"": ""Button"", ""type"": ""Button"",
""id"": ""133cd9f7-2cbb-4e69-a67f-929b5f258cef"", ""id"": ""0deec593-3bdc-4a97-9b78-bc841ed7d75c"",
""expectedControlType"": ""Button"", ""expectedControlType"": ""Button"",
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
@@ -604,16 +613,7 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
{ {
""name"": ""Cancel"", ""name"": ""Cancel"",
""type"": ""Button"", ""type"": ""Button"",
""id"": ""d6902a56-8d24-401e-a0e7-1d9f24743377"", ""id"": ""b304717b-ed90-4179-8543-fac11a253476"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Pause"",
""type"": ""Button"",
""id"": ""bb4dfee5-99f7-43a5-971f-2e727227ae24"",
""expectedControlType"": ""Button"", ""expectedControlType"": ""Button"",
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
@@ -621,29 +621,72 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""Point"", ""name"": ""Point"",
""type"": ""Value"", ""type"": ""PassThrough"",
""id"": ""4e32bfb2-f45a-4606-8b3f-74578320de78"", ""id"": ""97dfade5-1878-4e11-8309-5a63013df36b"",
""expectedControlType"": ""Vector2"", ""expectedControlType"": ""Vector2"",
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
""initialStateCheck"": true ""initialStateCheck"": true
},
{
""name"": ""Click"",
""type"": ""PassThrough"",
""id"": ""1f4a2847-9ec5-474b-9743-5f4ff65a2479"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""ScrollWheel"",
""type"": ""PassThrough"",
""id"": ""7139aa93-a0de-4ac9-9f0d-b804e9d38c30"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""MiddleClick"",
""type"": ""PassThrough"",
""id"": ""9e9a8297-7298-4c98-94f5-dba6950ea2ba"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""RightClick"",
""type"": ""PassThrough"",
""id"": ""a9dfbbec-1954-43bb-ba82-9553ef02752c"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""TrackedDevicePosition"",
""type"": ""PassThrough"",
""id"": ""8e630404-0267-4c8f-af31-a26398ce7cf9"",
""expectedControlType"": ""Vector3"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""TrackedDeviceOrientation"",
""type"": ""PassThrough"",
""id"": ""8657997d-5de9-4a9e-bd3e-e9b00f9f8791"",
""expectedControlType"": ""Quaternion"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
} }
], ],
""bindings"": [ ""bindings"": [
{ {
""name"": """", ""name"": ""Gamepad"",
""id"": ""33e3a0ed-3d92-4e66-89f1-d35c7f47a2bd"", ""id"": ""1d26a74e-68cf-48c7-85f2-c85244e2c86f"",
""path"": ""<Gamepad>/leftStick"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": ""2D Vector"",
""id"": ""0445f630-8dc6-438d-bbe9-46c34ae7abc6"",
""path"": ""2DVector"", ""path"": ""2DVector"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -654,7 +697,183 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""up"", ""name"": ""up"",
""id"": ""60f27c2f-f363-44bb-b0f4-cdef654322ae"", ""id"": ""b489e707-914b-4478-b911-10e75a73e5c2"",
""path"": ""<Gamepad>/leftStick/up"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""up"",
""id"": ""10f2d6a4-94da-4d79-88cc-a9dadadfa120"",
""path"": ""<Gamepad>/rightStick/up"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""ddd79bd5-5503-4eab-aca2-93d92575a84a"",
""path"": ""<Gamepad>/leftStick/down"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""9b164cbe-a66c-4caf-ba09-a6f84b36475a"",
""path"": ""<Gamepad>/rightStick/down"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""b59f3f33-9730-422a-99c1-2695cec5e48a"",
""path"": ""<Gamepad>/leftStick/left"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""506400ef-6960-4032-9624-6ec131423eb2"",
""path"": ""<Gamepad>/rightStick/left"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""2c07c3b4-699b-4dde-ab28-5bd8f190eaf3"",
""path"": ""<Gamepad>/leftStick/right"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""6a545dc0-75d7-4556-8af8-c060d951a2c2"",
""path"": ""<Gamepad>/rightStick/right"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": """",
""id"": ""38b742b3-8125-485c-ab6d-8bfe034acb78"",
""path"": ""<Gamepad>/dpad"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": ""Joystick"",
""id"": ""707eaebc-a6db-449c-9c83-ae6773cdcaf7"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Navigate"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""9714a5ad-d5fb-44c3-be0f-a134a5ddb03b"",
""path"": ""<Joystick>/stick/up"",
""interactions"": """",
""processors"": """",
""groups"": ""Joystick"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""9eef44a9-6c59-4dba-9e52-1a51edf8255e"",
""path"": ""<Joystick>/stick/down"",
""interactions"": """",
""processors"": """",
""groups"": ""Joystick"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""75219c79-9470-41e8-88ef-a35eb5d532a5"",
""path"": ""<Joystick>/stick/left"",
""interactions"": """",
""processors"": """",
""groups"": ""Joystick"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""0eb30457-c8b6-426a-bd9a-919d3d720fef"",
""path"": ""<Joystick>/stick/right"",
""interactions"": """",
""processors"": """",
""groups"": ""Joystick"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""Keyboard"",
""id"": ""d19dae69-faee-40a3-87c0-a292c879607d"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Navigate"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""f1745283-5e7c-4121-a44e-91e4a12a86a2"",
""path"": ""<Keyboard>/w"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""up"",
""id"": ""fec1489f-16c5-49ea-8be3-f29336444c5a"",
""path"": ""<Keyboard>/upArrow"", ""path"": ""<Keyboard>/upArrow"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -665,7 +884,18 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""down"", ""name"": ""down"",
""id"": ""4567655f-b7a9-4458-a0c0-929d4020a401"", ""id"": ""f10707c9-071c-41f2-b97f-5f46cb95b15e"",
""path"": ""<Keyboard>/s"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""be8f5a8e-a4a9-4bbe-91a8-ae2811ff9696"",
""path"": ""<Keyboard>/downArrow"", ""path"": ""<Keyboard>/downArrow"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -676,7 +906,18 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""left"", ""name"": ""left"",
""id"": ""f10bf7f0-6a08-4d8a-893d-efe31c6a95e3"", ""id"": ""78875792-1535-4c46-9fad-6b6c7ae75bcd"",
""path"": ""<Keyboard>/a"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""fba38f2f-4996-47fc-b369-8480e9593f0b"",
""path"": ""<Keyboard>/leftArrow"", ""path"": ""<Keyboard>/leftArrow"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -687,7 +928,18 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": ""right"", ""name"": ""right"",
""id"": ""da749bdf-d05f-490c-827f-ab184a156c66"", ""id"": ""3fa9923b-edfb-4def-abf8-801b7d9e77ca"",
""path"": ""<Keyboard>/d"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Navigate"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""aa7524f2-5737-44b0-8783-6e7a722ccdd5"",
""path"": ""<Keyboard>/rightArrow"", ""path"": ""<Keyboard>/rightArrow"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -698,51 +950,7 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": """", ""name"": """",
""id"": ""6cc5c2c6-aa18-4f9e-a5ab-624147a93203"", ""id"": ""5c3030c2-489b-43cc-92c3-c5eed849affa"",
""path"": ""<Keyboard>/enter"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Submit"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""80758152-6c57-4b22-add3-98b2a6b1c113"",
""path"": ""<Gamepad>/buttonSouth"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Submit"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""f8621671-e257-429a-b12c-2bfb1b6fa21c"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Cancel"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""0ca5a00e-8110-45e3-8465-0cbb6f3ea4aa"",
""path"": ""<Gamepad>/buttonEast"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Cancel"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""58af2641-5e8b-4e49-89e6-5e47ada4fb07"",
""path"": ""<Keyboard>/escape"", ""path"": ""<Keyboard>/escape"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -753,7 +961,7 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": """", ""name"": """",
""id"": ""85ed737c-425e-4e66-a050-12b1ae5588ce"", ""id"": ""5632ce4b-cb65-4d5a-a133-262727b68139"",
""path"": ""<Gamepad>/start"", ""path"": ""<Gamepad>/start"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -764,7 +972,29 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": """", ""name"": """",
""id"": ""4add46ae-9c9a-4385-b180-5cd650aa89a6"", ""id"": ""5ef7192c-3c67-4fff-b29a-b21377bbc430"",
""path"": ""*/{Submit}"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"",
""action"": ""Submit"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e6b74122-53a6-4ad1-85fb-dce8de71bf51"",
""path"": ""*/{Cancel}"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"",
""action"": ""Cancel"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""448f17c8-8894-41c7-b41b-f39fceb9928f"",
""path"": ""<Mouse>/position"", ""path"": ""<Mouse>/position"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
@@ -772,6 +1002,127 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
""action"": ""Point"", ""action"": ""Point"",
""isComposite"": false, ""isComposite"": false,
""isPartOfComposite"": false ""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""8ac9363b-5554-4db1-921a-76f0cd7c4630"",
""path"": ""<Pen>/position"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Point"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""80efa3a9-c91c-428c-8f39-6d2924cbaae2"",
""path"": ""<Touchscreen>/touch*/position"",
""interactions"": """",
""processors"": """",
""groups"": ""Touch"",
""action"": ""Point"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""7ea9b409-669b-46f6-b0af-c717a1406c95"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""0b684379-4daa-4656-9253-d07b04775dd2"",
""path"": ""<Pen>/tip"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""f4d64e59-b1a7-4517-9a7a-39972e4ae64a"",
""path"": ""<Touchscreen>/touch*/press"",
""interactions"": """",
""processors"": """",
""groups"": ""Touch"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""1910f113-09ab-4ef0-b126-6a638f38e7d1"",
""path"": ""<XRController>/trigger"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""954897cb-1087-472a-b353-b041397ef647"",
""path"": ""<Mouse>/scroll"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""ScrollWheel"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""591b8687-9f7e-498c-9cb6-aeafaa9013e7"",
""path"": ""<Mouse>/middleButton"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""MiddleClick"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""790f83ba-a25d-4b98-ab40-e38af127bf61"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""RightClick"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""26afc077-19d7-4014-984e-7ec31b029ec7"",
""path"": ""<XRController>/devicePosition"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""TrackedDevicePosition"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e4e7f9d2-6793-4d26-a064-5502fb8a94b1"",
""path"": ""<XRController>/deviceRotation"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""TrackedDeviceOrientation"",
""isComposite"": false,
""isPartOfComposite"": false
} }
] ]
} }
@@ -828,10 +1179,16 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
// UI // UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true); m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true); m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true);
m_UI_Pause = m_UI.FindAction("Pause", throwIfNotFound: true);
m_UI_Submit = m_UI.FindAction("Submit", throwIfNotFound: true); m_UI_Submit = m_UI.FindAction("Submit", throwIfNotFound: true);
m_UI_Cancel = m_UI.FindAction("Cancel", throwIfNotFound: true); m_UI_Cancel = m_UI.FindAction("Cancel", throwIfNotFound: true);
m_UI_Pause = m_UI.FindAction("Pause", throwIfNotFound: true);
m_UI_Point = m_UI.FindAction("Point", throwIfNotFound: true); m_UI_Point = m_UI.FindAction("Point", throwIfNotFound: true);
m_UI_Click = m_UI.FindAction("Click", throwIfNotFound: true);
m_UI_ScrollWheel = m_UI.FindAction("ScrollWheel", throwIfNotFound: true);
m_UI_MiddleClick = m_UI.FindAction("MiddleClick", throwIfNotFound: true);
m_UI_RightClick = m_UI.FindAction("RightClick", throwIfNotFound: true);
m_UI_TrackedDevicePosition = m_UI.FindAction("TrackedDevicePosition", throwIfNotFound: true);
m_UI_TrackedDeviceOrientation = m_UI.FindAction("TrackedDeviceOrientation", throwIfNotFound: true);
} }
~@PlayerInputActions() ~@PlayerInputActions()
@@ -1186,10 +1543,16 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
private readonly InputActionMap m_UI; private readonly InputActionMap m_UI;
private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>(); private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
private readonly InputAction m_UI_Navigate; private readonly InputAction m_UI_Navigate;
private readonly InputAction m_UI_Pause;
private readonly InputAction m_UI_Submit; private readonly InputAction m_UI_Submit;
private readonly InputAction m_UI_Cancel; private readonly InputAction m_UI_Cancel;
private readonly InputAction m_UI_Pause;
private readonly InputAction m_UI_Point; private readonly InputAction m_UI_Point;
private readonly InputAction m_UI_Click;
private readonly InputAction m_UI_ScrollWheel;
private readonly InputAction m_UI_MiddleClick;
private readonly InputAction m_UI_RightClick;
private readonly InputAction m_UI_TrackedDevicePosition;
private readonly InputAction m_UI_TrackedDeviceOrientation;
/// <summary> /// <summary>
/// Provides access to input actions defined in input action map "UI". /// Provides access to input actions defined in input action map "UI".
/// </summary> /// </summary>
@@ -1206,6 +1569,10 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
/// </summary> /// </summary>
public InputAction @Navigate => m_Wrapper.m_UI_Navigate; public InputAction @Navigate => m_Wrapper.m_UI_Navigate;
/// <summary> /// <summary>
/// Provides access to the underlying input action "UI/Pause".
/// </summary>
public InputAction @Pause => m_Wrapper.m_UI_Pause;
/// <summary>
/// Provides access to the underlying input action "UI/Submit". /// Provides access to the underlying input action "UI/Submit".
/// </summary> /// </summary>
public InputAction @Submit => m_Wrapper.m_UI_Submit; public InputAction @Submit => m_Wrapper.m_UI_Submit;
@@ -1214,14 +1581,34 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
/// </summary> /// </summary>
public InputAction @Cancel => m_Wrapper.m_UI_Cancel; public InputAction @Cancel => m_Wrapper.m_UI_Cancel;
/// <summary> /// <summary>
/// Provides access to the underlying input action "UI/Pause".
/// </summary>
public InputAction @Pause => m_Wrapper.m_UI_Pause;
/// <summary>
/// Provides access to the underlying input action "UI/Point". /// Provides access to the underlying input action "UI/Point".
/// </summary> /// </summary>
public InputAction @Point => m_Wrapper.m_UI_Point; public InputAction @Point => m_Wrapper.m_UI_Point;
/// <summary> /// <summary>
/// Provides access to the underlying input action "UI/Click".
/// </summary>
public InputAction @Click => m_Wrapper.m_UI_Click;
/// <summary>
/// Provides access to the underlying input action "UI/ScrollWheel".
/// </summary>
public InputAction @ScrollWheel => m_Wrapper.m_UI_ScrollWheel;
/// <summary>
/// Provides access to the underlying input action "UI/MiddleClick".
/// </summary>
public InputAction @MiddleClick => m_Wrapper.m_UI_MiddleClick;
/// <summary>
/// Provides access to the underlying input action "UI/RightClick".
/// </summary>
public InputAction @RightClick => m_Wrapper.m_UI_RightClick;
/// <summary>
/// Provides access to the underlying input action "UI/TrackedDevicePosition".
/// </summary>
public InputAction @TrackedDevicePosition => m_Wrapper.m_UI_TrackedDevicePosition;
/// <summary>
/// Provides access to the underlying input action "UI/TrackedDeviceOrientation".
/// </summary>
public InputAction @TrackedDeviceOrientation => m_Wrapper.m_UI_TrackedDeviceOrientation;
/// <summary>
/// Provides access to the underlying input action map instance. /// Provides access to the underlying input action map instance.
/// </summary> /// </summary>
public InputActionMap Get() { return m_Wrapper.m_UI; } public InputActionMap Get() { return m_Wrapper.m_UI; }
@@ -1250,18 +1637,36 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
@Navigate.started += instance.OnNavigate; @Navigate.started += instance.OnNavigate;
@Navigate.performed += instance.OnNavigate; @Navigate.performed += instance.OnNavigate;
@Navigate.canceled += instance.OnNavigate; @Navigate.canceled += instance.OnNavigate;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
@Submit.started += instance.OnSubmit; @Submit.started += instance.OnSubmit;
@Submit.performed += instance.OnSubmit; @Submit.performed += instance.OnSubmit;
@Submit.canceled += instance.OnSubmit; @Submit.canceled += instance.OnSubmit;
@Cancel.started += instance.OnCancel; @Cancel.started += instance.OnCancel;
@Cancel.performed += instance.OnCancel; @Cancel.performed += instance.OnCancel;
@Cancel.canceled += instance.OnCancel; @Cancel.canceled += instance.OnCancel;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
@Point.started += instance.OnPoint; @Point.started += instance.OnPoint;
@Point.performed += instance.OnPoint; @Point.performed += instance.OnPoint;
@Point.canceled += instance.OnPoint; @Point.canceled += instance.OnPoint;
@Click.started += instance.OnClick;
@Click.performed += instance.OnClick;
@Click.canceled += instance.OnClick;
@ScrollWheel.started += instance.OnScrollWheel;
@ScrollWheel.performed += instance.OnScrollWheel;
@ScrollWheel.canceled += instance.OnScrollWheel;
@MiddleClick.started += instance.OnMiddleClick;
@MiddleClick.performed += instance.OnMiddleClick;
@MiddleClick.canceled += instance.OnMiddleClick;
@RightClick.started += instance.OnRightClick;
@RightClick.performed += instance.OnRightClick;
@RightClick.canceled += instance.OnRightClick;
@TrackedDevicePosition.started += instance.OnTrackedDevicePosition;
@TrackedDevicePosition.performed += instance.OnTrackedDevicePosition;
@TrackedDevicePosition.canceled += instance.OnTrackedDevicePosition;
@TrackedDeviceOrientation.started += instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.performed += instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.canceled += instance.OnTrackedDeviceOrientation;
} }
/// <summary> /// <summary>
@@ -1276,18 +1681,36 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
@Navigate.started -= instance.OnNavigate; @Navigate.started -= instance.OnNavigate;
@Navigate.performed -= instance.OnNavigate; @Navigate.performed -= instance.OnNavigate;
@Navigate.canceled -= instance.OnNavigate; @Navigate.canceled -= instance.OnNavigate;
@Pause.started -= instance.OnPause;
@Pause.performed -= instance.OnPause;
@Pause.canceled -= instance.OnPause;
@Submit.started -= instance.OnSubmit; @Submit.started -= instance.OnSubmit;
@Submit.performed -= instance.OnSubmit; @Submit.performed -= instance.OnSubmit;
@Submit.canceled -= instance.OnSubmit; @Submit.canceled -= instance.OnSubmit;
@Cancel.started -= instance.OnCancel; @Cancel.started -= instance.OnCancel;
@Cancel.performed -= instance.OnCancel; @Cancel.performed -= instance.OnCancel;
@Cancel.canceled -= instance.OnCancel; @Cancel.canceled -= instance.OnCancel;
@Pause.started -= instance.OnPause;
@Pause.performed -= instance.OnPause;
@Pause.canceled -= instance.OnPause;
@Point.started -= instance.OnPoint; @Point.started -= instance.OnPoint;
@Point.performed -= instance.OnPoint; @Point.performed -= instance.OnPoint;
@Point.canceled -= instance.OnPoint; @Point.canceled -= instance.OnPoint;
@Click.started -= instance.OnClick;
@Click.performed -= instance.OnClick;
@Click.canceled -= instance.OnClick;
@ScrollWheel.started -= instance.OnScrollWheel;
@ScrollWheel.performed -= instance.OnScrollWheel;
@ScrollWheel.canceled -= instance.OnScrollWheel;
@MiddleClick.started -= instance.OnMiddleClick;
@MiddleClick.performed -= instance.OnMiddleClick;
@MiddleClick.canceled -= instance.OnMiddleClick;
@RightClick.started -= instance.OnRightClick;
@RightClick.performed -= instance.OnRightClick;
@RightClick.canceled -= instance.OnRightClick;
@TrackedDevicePosition.started -= instance.OnTrackedDevicePosition;
@TrackedDevicePosition.performed -= instance.OnTrackedDevicePosition;
@TrackedDevicePosition.canceled -= instance.OnTrackedDevicePosition;
@TrackedDeviceOrientation.started -= instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.performed -= instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.canceled -= instance.OnTrackedDeviceOrientation;
} }
/// <summary> /// <summary>
@@ -1489,6 +1912,13 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnNavigate(InputAction.CallbackContext context); void OnNavigate(InputAction.CallbackContext context);
/// <summary> /// <summary>
/// Method invoked when associated input action "Pause" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnPause(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Submit" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />. /// Method invoked when associated input action "Submit" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary> /// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
@@ -1503,18 +1933,53 @@ public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnCancel(InputAction.CallbackContext context); void OnCancel(InputAction.CallbackContext context);
/// <summary> /// <summary>
/// Method invoked when associated input action "Pause" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnPause(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Point" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />. /// Method invoked when associated input action "Point" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary> /// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnPoint(InputAction.CallbackContext context); void OnPoint(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Click" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnClick(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "ScrollWheel" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnScrollWheel(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "MiddleClick" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnMiddleClick(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "RightClick" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnRightClick(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "TrackedDevicePosition" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnTrackedDevicePosition(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "TrackedDeviceOrientation" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnTrackedDeviceOrientation(InputAction.CallbackContext context);
} }
} }

View File

@@ -145,7 +145,7 @@
"name": "Pause", "name": "Pause",
"type": "Button", "type": "Button",
"id": "b15ae123-2d81-4473-a16f-dc7f1a9d3527", "id": "b15ae123-2d81-4473-a16f-dc7f1a9d3527",
"expectedControlType": "Button", "expectedControlType": "",
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": false "initialStateCheck": false
@@ -495,21 +495,30 @@
}, },
{ {
"name": "UI", "name": "UI",
"id": "905d74a5-6596-4177-8377-8a05d113b186", "id": "ba1e4240-82fc-40d3-ac98-5fe1f6ed88c0",
"actions": [ "actions": [
{ {
"name": "Navigate", "name": "Navigate",
"type": "Value", "type": "PassThrough",
"id": "16469da9-bfd0-4a21-a370-d89bdb682245", "id": "f8fcd154-d35c-40b0-b99a-0d1df5fa2e1f",
"expectedControlType": "Vector2", "expectedControlType": "Vector2",
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": true "initialStateCheck": false
},
{
"name": "Pause",
"type": "Button",
"id": "2d22c992-df5f-4d63-8a35-42a1464f7ff3",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
}, },
{ {
"name": "Submit", "name": "Submit",
"type": "Button", "type": "Button",
"id": "133cd9f7-2cbb-4e69-a67f-929b5f258cef", "id": "0deec593-3bdc-4a97-9b78-bc841ed7d75c",
"expectedControlType": "Button", "expectedControlType": "Button",
"processors": "", "processors": "",
"interactions": "", "interactions": "",
@@ -518,16 +527,7 @@
{ {
"name": "Cancel", "name": "Cancel",
"type": "Button", "type": "Button",
"id": "d6902a56-8d24-401e-a0e7-1d9f24743377", "id": "b304717b-ed90-4179-8543-fac11a253476",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Pause",
"type": "Button",
"id": "bb4dfee5-99f7-43a5-971f-2e727227ae24",
"expectedControlType": "Button", "expectedControlType": "Button",
"processors": "", "processors": "",
"interactions": "", "interactions": "",
@@ -535,29 +535,72 @@
}, },
{ {
"name": "Point", "name": "Point",
"type": "Value", "type": "PassThrough",
"id": "4e32bfb2-f45a-4606-8b3f-74578320de78", "id": "97dfade5-1878-4e11-8309-5a63013df36b",
"expectedControlType": "Vector2", "expectedControlType": "Vector2",
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": true "initialStateCheck": true
},
{
"name": "Click",
"type": "PassThrough",
"id": "1f4a2847-9ec5-474b-9743-5f4ff65a2479",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": true
},
{
"name": "ScrollWheel",
"type": "PassThrough",
"id": "7139aa93-a0de-4ac9-9f0d-b804e9d38c30",
"expectedControlType": "Vector2",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "MiddleClick",
"type": "PassThrough",
"id": "9e9a8297-7298-4c98-94f5-dba6950ea2ba",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "RightClick",
"type": "PassThrough",
"id": "a9dfbbec-1954-43bb-ba82-9553ef02752c",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "TrackedDevicePosition",
"type": "PassThrough",
"id": "8e630404-0267-4c8f-af31-a26398ce7cf9",
"expectedControlType": "Vector3",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "TrackedDeviceOrientation",
"type": "PassThrough",
"id": "8657997d-5de9-4a9e-bd3e-e9b00f9f8791",
"expectedControlType": "Quaternion",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
{ {
"name": "", "name": "Gamepad",
"id": "33e3a0ed-3d92-4e66-89f1-d35c7f47a2bd", "id": "1d26a74e-68cf-48c7-85f2-c85244e2c86f",
"path": "<Gamepad>/leftStick",
"interactions": "",
"processors": "",
"groups": "Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "2D Vector",
"id": "0445f630-8dc6-438d-bbe9-46c34ae7abc6",
"path": "2DVector", "path": "2DVector",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -568,7 +611,183 @@
}, },
{ {
"name": "up", "name": "up",
"id": "60f27c2f-f363-44bb-b0f4-cdef654322ae", "id": "b489e707-914b-4478-b911-10e75a73e5c2",
"path": "<Gamepad>/leftStick/up",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "up",
"id": "10f2d6a4-94da-4d79-88cc-a9dadadfa120",
"path": "<Gamepad>/rightStick/up",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "ddd79bd5-5503-4eab-aca2-93d92575a84a",
"path": "<Gamepad>/leftStick/down",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "9b164cbe-a66c-4caf-ba09-a6f84b36475a",
"path": "<Gamepad>/rightStick/down",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "b59f3f33-9730-422a-99c1-2695cec5e48a",
"path": "<Gamepad>/leftStick/left",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "506400ef-6960-4032-9624-6ec131423eb2",
"path": "<Gamepad>/rightStick/left",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "2c07c3b4-699b-4dde-ab28-5bd8f190eaf3",
"path": "<Gamepad>/leftStick/right",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "6a545dc0-75d7-4556-8af8-c060d951a2c2",
"path": "<Gamepad>/rightStick/right",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "",
"id": "38b742b3-8125-485c-ab6d-8bfe034acb78",
"path": "<Gamepad>/dpad",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "Joystick",
"id": "707eaebc-a6db-449c-9c83-ae6773cdcaf7",
"path": "2DVector",
"interactions": "",
"processors": "",
"groups": "",
"action": "Navigate",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "up",
"id": "9714a5ad-d5fb-44c3-be0f-a134a5ddb03b",
"path": "<Joystick>/stick/up",
"interactions": "",
"processors": "",
"groups": "Joystick",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "9eef44a9-6c59-4dba-9e52-1a51edf8255e",
"path": "<Joystick>/stick/down",
"interactions": "",
"processors": "",
"groups": "Joystick",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "75219c79-9470-41e8-88ef-a35eb5d532a5",
"path": "<Joystick>/stick/left",
"interactions": "",
"processors": "",
"groups": "Joystick",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "0eb30457-c8b6-426a-bd9a-919d3d720fef",
"path": "<Joystick>/stick/right",
"interactions": "",
"processors": "",
"groups": "Joystick",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "Keyboard",
"id": "d19dae69-faee-40a3-87c0-a292c879607d",
"path": "2DVector",
"interactions": "",
"processors": "",
"groups": "",
"action": "Navigate",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "up",
"id": "f1745283-5e7c-4121-a44e-91e4a12a86a2",
"path": "<Keyboard>/w",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "up",
"id": "fec1489f-16c5-49ea-8be3-f29336444c5a",
"path": "<Keyboard>/upArrow", "path": "<Keyboard>/upArrow",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -579,7 +798,18 @@
}, },
{ {
"name": "down", "name": "down",
"id": "4567655f-b7a9-4458-a0c0-929d4020a401", "id": "f10707c9-071c-41f2-b97f-5f46cb95b15e",
"path": "<Keyboard>/s",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "be8f5a8e-a4a9-4bbe-91a8-ae2811ff9696",
"path": "<Keyboard>/downArrow", "path": "<Keyboard>/downArrow",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -590,7 +820,18 @@
}, },
{ {
"name": "left", "name": "left",
"id": "f10bf7f0-6a08-4d8a-893d-efe31c6a95e3", "id": "78875792-1535-4c46-9fad-6b6c7ae75bcd",
"path": "<Keyboard>/a",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "fba38f2f-4996-47fc-b369-8480e9593f0b",
"path": "<Keyboard>/leftArrow", "path": "<Keyboard>/leftArrow",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -601,7 +842,18 @@
}, },
{ {
"name": "right", "name": "right",
"id": "da749bdf-d05f-490c-827f-ab184a156c66", "id": "3fa9923b-edfb-4def-abf8-801b7d9e77ca",
"path": "<Keyboard>/d",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Navigate",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "aa7524f2-5737-44b0-8783-6e7a722ccdd5",
"path": "<Keyboard>/rightArrow", "path": "<Keyboard>/rightArrow",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -612,51 +864,7 @@
}, },
{ {
"name": "", "name": "",
"id": "6cc5c2c6-aa18-4f9e-a5ab-624147a93203", "id": "5c3030c2-489b-43cc-92c3-c5eed849affa",
"path": "<Keyboard>/enter",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Submit",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "80758152-6c57-4b22-add3-98b2a6b1c113",
"path": "<Gamepad>/buttonSouth",
"interactions": "",
"processors": "",
"groups": "Gamepad",
"action": "Submit",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "f8621671-e257-429a-b12c-2bfb1b6fa21c",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Cancel",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "0ca5a00e-8110-45e3-8465-0cbb6f3ea4aa",
"path": "<Gamepad>/buttonEast",
"interactions": "",
"processors": "",
"groups": "Gamepad",
"action": "Cancel",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "58af2641-5e8b-4e49-89e6-5e47ada4fb07",
"path": "<Keyboard>/escape", "path": "<Keyboard>/escape",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -667,7 +875,7 @@
}, },
{ {
"name": "", "name": "",
"id": "85ed737c-425e-4e66-a050-12b1ae5588ce", "id": "5632ce4b-cb65-4d5a-a133-262727b68139",
"path": "<Gamepad>/start", "path": "<Gamepad>/start",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -678,7 +886,29 @@
}, },
{ {
"name": "", "name": "",
"id": "4add46ae-9c9a-4385-b180-5cd650aa89a6", "id": "5ef7192c-3c67-4fff-b29a-b21377bbc430",
"path": "*/{Submit}",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR",
"action": "Submit",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e6b74122-53a6-4ad1-85fb-dce8de71bf51",
"path": "*/{Cancel}",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR",
"action": "Cancel",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "448f17c8-8894-41c7-b41b-f39fceb9928f",
"path": "<Mouse>/position", "path": "<Mouse>/position",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
@@ -686,6 +916,127 @@
"action": "Point", "action": "Point",
"isComposite": false, "isComposite": false,
"isPartOfComposite": false "isPartOfComposite": false
},
{
"name": "",
"id": "8ac9363b-5554-4db1-921a-76f0cd7c4630",
"path": "<Pen>/position",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Point",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "80efa3a9-c91c-428c-8f39-6d2924cbaae2",
"path": "<Touchscreen>/touch*/position",
"interactions": "",
"processors": "",
"groups": "Touch",
"action": "Point",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "7ea9b409-669b-46f6-b0af-c717a1406c95",
"path": "<Mouse>/leftButton",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "0b684379-4daa-4656-9253-d07b04775dd2",
"path": "<Pen>/tip",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "f4d64e59-b1a7-4517-9a7a-39972e4ae64a",
"path": "<Touchscreen>/touch*/press",
"interactions": "",
"processors": "",
"groups": "Touch",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "1910f113-09ab-4ef0-b126-6a638f38e7d1",
"path": "<XRController>/trigger",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "954897cb-1087-472a-b353-b041397ef647",
"path": "<Mouse>/scroll",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "ScrollWheel",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "591b8687-9f7e-498c-9cb6-aeafaa9013e7",
"path": "<Mouse>/middleButton",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "MiddleClick",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "790f83ba-a25d-4b98-ab40-e38af127bf61",
"path": "<Mouse>/rightButton",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "RightClick",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "26afc077-19d7-4014-984e-7ec31b029ec7",
"path": "<XRController>/devicePosition",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "TrackedDevicePosition",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e4e7f9d2-6793-4d26-a064-5502fb8a94b1",
"path": "<XRController>/deviceRotation",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "TrackedDeviceOrientation",
"isComposite": false,
"isPartOfComposite": false
} }
] ]
} }

View File

@@ -0,0 +1,262 @@
# Addressables Label标签命名与使用规范
> **版本**1.0
> **创建日期**2026-05
> **适用范围**`Assets/_Game/` 目录下所有注册到 Addressables 的资产
> **关联文档**`Standards/AssetFolderSpec.md §8`、`Scripts/Core/Assets/AddressKeys.cs`
---
## 目录
1. [设计原则](#1-设计原则)
2. [Label 清单](#2-label-清单)
3. [每类资产的 Label 分配](#3-每类资产的-label-分配)
4. [AddressKeys.cs 常量对照](#4-addresskeyscs-常量对照)
5. [使用规范与禁止行为](#5-使用规范与禁止行为)
6. [新增 Label 决策流程](#6-新增-label-决策流程)
---
## 1. 设计原则
### 1.1 Label 的作用
Addressable **Label** 是为"需要按类别批量操作"而设计的:
- **批量下载依赖**BootSequencer 预热)
- **批量加载资产列表**`Addressables.LoadAssetsAsync<T>(label, ...)`
- **构建分析/验证工具**筛选特定类别的资产
> **Label ≠ Group。** Group 决定打包策略(打入哪个 bundle、何时加载卸载Label 决定运行时如何批量引用。一个资产可同时属于某 Group 且带有多个 Label。
### 1.2 Label 命名格式
```
PascalCase不加前缀英文单词或词组
```
-`Poolable``Preload``Enemy`
-`lbl_poolable``POOLABLE``可对象池`
### 1.3 Label 膨胀控制
新增 Label 前必须满足**至少一条**
1. 有代码通过该 Label 进行 **批量异步加载**`LoadAssetsAsync`
2.**BootSequencer 预热需求**`DownloadDependenciesAsync`
3. 有 **编辑器工具**需要按 Label 筛选/校验资产
纯用于分类记录但代码不引用的标签,**不得创建**——用文件夹路径或 Group 命名代替。
---
## 2. Label 清单
| Label | 代码常量 | 用途 | 使用者 |
|-------|---------|------|--------|
| `Preload` | `AddressKeys.Labels.Preload` | 游戏启动时通过 `DownloadDependenciesAsync` 预热下载依赖。涵盖所有首帧可能用到的资产。 | `BootSequencer` |
| `Poolable` | `AddressKeys.Labels.Poolable` | 纳入 `GlobalObjectPool` 管理的 Prefab。标记此标签意味着该资产**必须**在 `GlobalObjectPool._warmupConfigs` 中配置初始池数量。 | `GlobalObjectPool``AddressKeyValidator` |
| `Enemy` | `AddressKeys.Labels.Enemy` | 所有敌人顶级 Prefab。用于区域 Spawner 通过 `LoadAssetsAsync<GameObject>(Labels.Enemy, ...)` 批量加载该区域敌人,或工具统计敌人总数。 | 区域 EnemySpawner待实现 |
| `BGM` | `AddressKeys.Labels.BGM` | 背景音乐 AudioClip 或 FMOD bank 引用 SO。`AudioManager` 通过此标签批量加载 BGM 目录,按 ID 播放。 | `AudioManager` |
| `SFX` | `AddressKeys.Labels.SFX` | 音效 AudioClip 或 SFX 配置 SO。与 `BGM` 平行,供 `AudioManager` 批量建立 SFX 索引。 | `AudioManager` |
| `Charms` | `AddressKeys.Labels.Charms` | 所有护身符配置 SO`CHM_*.asset`)。`EquipmentManager` / 护身符选择 UI 通过此标签加载完整护身符列表,无需逐一引用。 | `EquipmentManager`、护身符选择界面 |
| `Config` | `AddressKeys.Labels.Config` | 运行时**动态加载**的配置类 SO`Config/FootstepCatalog`)。**静态引用**Inspector 直接拖拽)的 SO 不加此标签。 | `AssetLoader`、各需要延迟加载配置的系统 |
| `Weapon` | `AddressKeys.Labels.Weapon` | 所有武器 Prefab`WPN_*.prefab`)。玩家换形态时通过此标签加载对应武器列表,避免硬编码每把武器地址。 | `PlayerFormController`(待实现) |
---
## 3. 每类资产的 Label 分配
### 3.1 场景Scenes
| Address | 所在 Group | Labels |
|---------|-----------|--------|
| `Scene_Persistent` | `Scenes` | ——(常驻,无需 Label |
| `Scene_MainMenu` | `Scenes` | `Preload` |
| `Room_{Region}_{nn}` | `Room_{Region}` | ——(区域加载时整组载入) |
| `Boss_{Name}` | `Boss_{Name}` | ——Boss 战前整组载入) |
> 测试专用场景(`Scenes/Testings/`**不注册 Addressable**,不分配任何 Label。
---
### 3.2 玩家Player
| Address | Labels | 说明 |
|---------|--------|------|
| `PLY_Player` | `Preload` | 玩家 Prefab 在进入 Gameplay 前必须就绪 |
---
### 3.3 敌人Enemies
| Address | Labels | 说明 |
|---------|--------|------|
| `ENM_GruntWarrior` | `Enemy` | 无 `Preload`:区域加载时按需拉取 |
| `ENM_SkullArcher` | `Enemy` | 同上 |
| 新增敌人 `ENM_{Name}` | `Enemy` | 所有敌人必须加此 Label |
> 高频召唤的敌人(每关必出现)可**额外加 `Preload`** 参与启动预热。
---
### 3.4 投射物Projectiles
| Address | Labels | 说明 |
|---------|--------|------|
| `PROJ_Arrow` | `Poolable`, `Preload` | 对象池 + 启动预热 |
| `PROJ_Fireball` | `Poolable`, `Preload` | 同上 |
| `PROJ_SoulBall` | `Poolable`, `Preload` | 同上 |
| 新增 `PROJ_{Name}` | `Poolable`, `Preload` | 默认双标签 |
---
### 3.5 特效VFX
| Address | Labels | 说明 |
|---------|--------|------|
| `VFX_HitSpark` | `Poolable`, `Preload` | 命中特效,高频使用 |
| `VFX_BloodSplat` | `Poolable`, `Preload` | 同上 |
| `VFX_Explosion` | `Poolable`, `Preload` | 同上 |
| 新增通用 VFX | `Poolable`, `Preload` | 高频共用特效默认双标签 |
| 区域专属 VFX | `Poolable` | 仅 `Poolable`,不加 `Preload`(区域加载时预热) |
---
### 3.6 UI Prefab
| Address | Labels | 说明 |
|---------|--------|------|
| `UI_FloatingDamageText` | `Poolable`, `Preload` | 对象池 Prefab战斗中高频出现 |
| 其余 UI 面板 `UI_{Name}` | ——(或 `Preload` | 按需加载;全局常驻面板加 `Preload` |
---
### 3.7 收集物Collectibles
| Address | Labels | 说明 |
|---------|--------|------|
| `COL_LingZhu` | `Poolable`, `Preload` | 灵珠,战斗中高频掉落 |
| `COL_Item` | `Poolable`, `Preload` | 道具掉落 |
| `COL_HPOrb` | `Poolable`, `Preload` | 血球,战斗中高频掉落 |
| 新增 `COL_{Name}` | `Poolable`, `Preload` | 默认双标签 |
---
### 3.8 武器Weapons
| Address | Labels | 说明 |
|---------|--------|------|
| `WPN_SkyBlade` | `Weapon`, `Preload` | 默认形态武器,启动时预热 |
| `WPN_EarthClaw` | `Weapon`, `Preload` | 同上 |
| `WPN_SoulStaff` | `Weapon`, `Preload` | 同上 |
| 新增 `WPN_{Name}` | `Weapon` | 是否加 `Preload` 视形态是否为默认形态 |
---
### 3.9 护身符Charms
| Address | Labels | 说明 |
|---------|--------|------|
| `CHM_{Name}` | `Charms` | 所有护身符 SO 统一加此标签,供 EquipmentManager 批量加载 |
> 护身符 SO 不加 `Preload`——玩家进入装备界面时再批量拉取,不影响启动速度。
---
### 3.10 配置数据Config
| Address | Labels | 说明 |
|---------|--------|------|
| `Config/FootstepCatalog` | `Config`, `Preload` | 脚步音频目录Gameplay 开始前必须就绪 |
| 新增 `Config/{Name}` | `Config` | 是否加 `Preload` 视是否在 Gameplay 首帧使用 |
---
### 3.11 音频Audio
| Address | Labels | 说明 |
|---------|--------|------|
| BGM 资源 `AUD_BGM_{Name}` | `BGM` | AudioManager 批量建立 BGM 索引 |
| SFX 资源 `AUD_SFX_{Name}` | `SFX` | AudioManager 批量建立 SFX 索引 |
> 音频资源不加 `Preload`——由 AudioManager 在 BGM 播放前异步流式加载。
---
## 4. AddressKeys.cs 常量对照
代码中使用 Label 时,**禁止硬编码字符串**,统一引用 `AddressKeys.Labels` 内的常量:
```csharp
// ✅ 正确
await Addressables.DownloadDependenciesAsync(AddressKeys.Labels.Preload, false);
var enemies = await Addressables.LoadAssetsAsync<GameObject>(AddressKeys.Labels.Enemy, null);
// ❌ 禁止
await Addressables.DownloadDependenciesAsync("Preload", false);
```
当前 `AddressKeys.Labels` 完整清单:
| 常量 | 字符串值 |
|------|---------|
| `AddressKeys.Labels.Preload` | `"Preload"` |
| `AddressKeys.Labels.Poolable` | `"Poolable"` |
| `AddressKeys.Labels.Enemy` | `"Enemy"` |
| `AddressKeys.Labels.BGM` | `"BGM"` |
| `AddressKeys.Labels.SFX` | `"SFX"` |
| `AddressKeys.Labels.Charms` | `"Charms"` |
| `AddressKeys.Labels.Config` | `"Config"` |
| `AddressKeys.Labels.Weapon` | `"Weapon"` |
> 每次新增 Label 常量,同步在 Addressables Groups 窗口中创建同名标签,并在此文档 §2 增加说明行。
---
## 5. 使用规范与禁止行为
### 5.1 多标签组合规则
一个资产可同时附加多个 Label组合语义如下
| 组合 | 含义 |
|------|------|
| `Poolable` + `Preload` | 启动预热依赖 + 纳入对象池,适用于高频 VFX、投射物、收集物 |
| `Enemy` + `Preload` | 高频召唤敌人,启动时下载依赖(实例化仍由 Spawner 按需触发) |
| `Config` + `Preload` | 首帧必须可用的配置 SO |
| `Charms` 单独 | 进入装备界面时才批量加载,不参与启动预热 |
### 5.2 禁止行为
| 禁止 | 原因 |
|------|------|
| 给 **ScriptableObject 事件频道**`EVT_*.asset`)加任何 Label | 事件频道通过 Inspector 直接引用,不走 Addressables |
| 给 **子 Prefab**HitBox、HurtBox、骨骼节点加任何 Label | 子对象不单独注册 Addressable |
| 给 **Atlas**`.spriteatlas`)加任何 Label | Atlas 由 Prefab/Material 间接引用,无需 Label |
| 给 **Shader / Material** 加任何 Label | 随 Prefab 打包,无独立 Label 需求 |
| 给 **测试场景**`Scenes/Testings/`)加任何 Label | 不进入 Addressables不可加 Label |
| 代码中直接写字符串 Label`"Poolable"` | 必须用 `AddressKeys.Labels.Poolable` 常量 |
---
## 6. 新增 Label 决策流程
```
需要新增 Label
├── 是否有代码通过该 Label 执行 LoadAssetsAsync
│ ├── 是 → 可新增
│ └── 否 → 是否为 BootSequencer 预热需求?
│ ├── 是 → 可新增(并入 Preload不新建
│ └── 否 → 是否为编辑器验证工具需求?
│ ├── 是 → 可新增(文档注明仅供工具使用)
│ └── 否 → ❌ 不允许新增(用 Group 或文件夹替代)
新增 Label 的执行步骤:
1. 在 AddressKeys.Labels 类中添加 public const string {Name} = "{Name}";
2. 在 Addressables Groups 窗口 → Label 列表中创建同名标签
3. 在本文档 §2 Label 清单中追加说明行
4. 在本文档 §3 对应资产类型的表格中标注
5. 运行 AddressKeyValidator 验证无遗漏
```

View File

@@ -512,16 +512,21 @@ Config/DifficultyEasy
### 8.3 Label标签使用规范 ### 8.3 Label标签使用规范
> 完整定义见 `Standards/AddressablesLabelSpec.md`。
| 标签 | 用途 | 相关常量 | | 标签 | 用途 | 相关常量 |
|------|------|---------| |------|------|---------|
| `Enemy` | 所有敌人 Prefab用于 `LoadAssetsAsync` 批量实例化 | `AddressKeys.Labels.Enemy` | | `Preload` | 游戏启动时通过 `DownloadDependenciesAsync` 预热下载依赖 | `AddressKeys.Labels.Preload` |
| `Poolable` | 纳入对象池管理的 PrefabVFX、射物、收集物等)| `AddressKeys.Labels.Poolable` | | `Poolable` | 纳入 `GlobalObjectPool` 对象池管理的 PrefabVFX、射物、收集物等)| `AddressKeys.Labels.Poolable` |
| `BGM` | BGM 音频资源FMOD bank 或 AudioClip | `AddressKeys.Labels.BGM` | | `Enemy` | 所有敌人 Prefab用于区域 Spawner `LoadAssetsAsync` 批量加载 | `AddressKeys.Labels.Enemy` |
| `Charms` | 所有护身符 Prefab/SO用于护身符列表加载 | `AddressKeys.Labels.Charms` | | `BGM` | BGM 音频 AudioClip / FMOD bank 引用 SO | `AddressKeys.Labels.BGM` |
| `Preload` | 游戏启动时必须预加载的资产 | (待添加常量) | | `SFX` | 音效 AudioClip / SFX 配置 SO | `AddressKeys.Labels.SFX` |
| `Charms` | 所有护身符配置 SO供 EquipmentManager 批量加载列表 | `AddressKeys.Labels.Charms` |
| `Config` | 运行时动态加载的配置类 SO | `AddressKeys.Labels.Config` |
| `Weapon` | 所有武器 Prefab玩家换形态时批量加载 | `AddressKeys.Labels.Weapon` |
- 一个资产可附加多个标签(例如 `VFX_HitSpark` 同时有 `Poolable` 标签) - 一个资产可附加多个标签(例如 `VFX_HitSpark` 同时有 `Poolable``Preload` 标签)
- 新增标签前确认是否有批量加载的需求,避免标签膨胀 - 新增标签前确认是否有批量加载的实际需求,避免标签膨胀(决策流程见 `AddressablesLabelSpec.md §6`
### 8.4 AddressKeys.cs 维护流程 ### 8.4 AddressKeys.cs 维护流程

View File

@@ -8,12 +8,15 @@ EditorBuildSettings:
- enabled: 0 - enabled: 0
path: Assets/Scenes/SampleScene.unity path: Assets/Scenes/SampleScene.unity
guid: 8c9cfa26abfee488c85f1582747f6a02 guid: 8c9cfa26abfee488c85f1582747f6a02
- enabled: 0
path: Assets/_Game/Scenes/Persistent.unity
guid: 6372e5b8e07d7ae4eb37a184fc8e912d
- enabled: 0
path: Assets/_Game/Scenes/Testings/MainMenu.unity
guid: 2a1ec0c1f9a64054f95911d1cda97f6e
- enabled: 1 - enabled: 1
path: Assets/_Game/Scenes/Testings/TestRoomA.unity path: Assets/_Game/Scenes/Testings/TestRoomA.unity
guid: f11781b557031114087be5fab27f8dd4 guid: f11781b557031114087be5fab27f8dd4
- enabled: 1
path: Assets/_Game/Scenes/Persistent.unity
guid: 6372e5b8e07d7ae4eb37a184fc8e912d
m_configObjects: m_configObjects:
com.unity.addressableassets: {fileID: 11400000, guid: 5afba7e2911543d418af812de1160fb1, type: 2} com.unity.addressableassets: {fileID: 11400000, guid: 5afba7e2911543d418af812de1160fb1, type: 2}
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 6d0341a640ba64043a8cd70f771b962d, type: 3} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 6d0341a640ba64043a8cd70f771b962d, type: 3}