清理项目目录,引入 InputModule 做多平台输入适配

This commit is contained in:
SepComet
2026-06-16 17:09:19 +08:00
committed by basil
parent d28ccaa7f9
commit 29c4468d54
227 changed files with 16702 additions and 2059 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0015eb550e61afd47b3c2b1e4b30281d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
namespace SepCore.InputModule
{
public readonly struct InputBindingSnapshot
{
public InputBindingSnapshot(string overridesJson)
{
OverridesJson = overridesJson ?? string.Empty;
}
public string OverridesJson { get; }
public bool HasOverrides => !string.IsNullOrEmpty(OverridesJson);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37e063fcb3008b04984822e35f0fc443
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
using UnityEngine;
namespace SepCore.InputModule
{
public readonly struct InputCommand
{
public InputCommand(
InputActionId actionId,
InputContextId contextId,
InputCommandPhase phase,
InputDeviceKind deviceKind,
Vector2 vector2Value,
float scalarValue,
double time)
{
ActionId = actionId;
ContextId = contextId;
Phase = phase;
DeviceKind = deviceKind;
Vector2Value = vector2Value;
ScalarValue = scalarValue;
Time = time;
}
public InputActionId ActionId { get; }
public InputContextId ContextId { get; }
public InputCommandPhase Phase { get; }
public InputDeviceKind DeviceKind { get; }
public Vector2 Vector2Value { get; }
public float ScalarValue { get; }
public double Time { get; }
public bool IsPressed => ScalarValue > 0.5f;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5e4a224672596ce4f97e7de628bdfb74
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,21 @@
namespace SepCore.InputModule
{
public readonly struct InputPrompt
{
public InputPrompt(string textLabel, string spriteName = null)
{
TextLabel = textLabel ?? string.Empty;
SpriteName = spriteName ?? string.Empty;
}
public string TextLabel { get; }
public string SpriteName { get; }
public bool HasSprite => !string.IsNullOrEmpty(SpriteName);
public bool IsValid => !string.IsNullOrEmpty(TextLabel);
public static readonly InputPrompt None = new InputPrompt(string.Empty);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,33 @@
namespace SepCore.InputModule
{
public readonly struct RebindResult
{
public RebindResult(
RebindStatus status,
InputContextId contextId,
InputActionId actionId,
int bindingIndex,
string path,
string previousPath)
{
Status = status;
ContextId = contextId;
ActionId = actionId;
BindingIndex = bindingIndex;
Path = path ?? string.Empty;
PreviousPath = previousPath ?? string.Empty;
}
public RebindStatus Status { get; }
public InputContextId ContextId { get; }
public InputActionId ActionId { get; }
public int BindingIndex { get; }
public string Path { get; }
public string PreviousPath { get; }
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7fa4402e32895cf47bd7a4d30fb15ec7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ee3d2de89a7a3114097ea1547932e957
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
namespace SepCore.InputModule
{
public enum InputActionId
{
Unknown = 0,
Pause = 1,
Navigate = 2,
Confirm = 3,
Cancel = 4,
Move = 5,
Sprint = 6,
Interact = 7,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e5744682c4d693b45aecf8397d9414c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
namespace SepCore.InputModule
{
public enum InputCommandPhase
{
Started = 0,
Performed = 1,
Canceled = 2,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e5b60a18dd87bec43a87b7a63f9dba0b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
namespace SepCore.InputModule
{
public enum InputContextId
{
None = 0,
Global = 1,
UI = 2,
GameplayExplore = 3,
Dialog = 4,
Rebind = 5,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f34b39d43d5333748b77d1809281b6ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
namespace SepCore.InputModule
{
public enum InputDeviceKind
{
Unknown = 0,
KeyboardMouse = 1,
Gamepad = 2,
Touch = 3,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1205d37744db74045a2359d4185d7aa3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,12 @@
namespace SepCore.InputModule
{
public enum RebindStatus
{
Started = 0,
Succeeded = 1,
Canceled = 2,
Timeout = 3,
ConflictDetected = 4,
Error = 5,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0bd22251370a207409b12614eb800d72
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
namespace SepCore.InputModule
{
public interface IInputPromptMap
{
bool TryGetPrompt(InputActionId actionId, InputDeviceKind deviceKind, out InputPrompt prompt);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: