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

This commit is contained in:
SepComet
2026-06-06 16:35:39 +08:00
parent c8c26b8b2e
commit 5ede6846db
227 changed files with 16702 additions and 2059 deletions
@@ -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: