vampire-like/Assets/Plugins/InputModule/Base/Definition/DataStruct/InputCommand.cs

43 lines
1013 B
C#

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;
}
}