Firstborn/Library/PackageCache/com.unity.inputsystem@1.4.4/InputSystem/Controls/DoubleControl.cs

31 lines
818 B
C#
Raw Normal View History

2023-03-28 13:24:16 -04:00
using UnityEngine.InputSystem.LowLevel;
namespace UnityEngine.InputSystem.Controls
{
/// <summary>
/// A control reading a <see cref="double"/>.
/// </summary>
public class DoubleControl : InputControl<double>
{
/// <summary>
/// Default-initialize the control.
/// </summary>
public DoubleControl()
{
m_StateBlock.format = InputStateBlock.FormatDouble;
}
/// <inheritdoc/>
public override unsafe double ReadUnprocessedValueFromState(void* statePtr)
{
return m_StateBlock.ReadDouble(statePtr);
}
/// <inheritdoc/>
public override unsafe void WriteValueIntoState(double value, void* statePtr)
{
m_StateBlock.WriteDouble(statePtr, value);
}
}
}