清理项目目录,引入 InputModule 做多平台输入适配
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user