UI 자동화를 위해 바인딩 기능 구현
- 유니티 에셋 인증 오류로 meta 재생성
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.InputSystem.Processors
|
||||
{
|
||||
/// <summary>
|
||||
/// An input processor that inverts its input value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This process is registered (see <see cref="InputSystem.RegisterProcessor{T}"/> as "invert" by default.
|
||||
///
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// // Bind to the gamepad's left trigger such that it returns inverted values.
|
||||
/// new InputAction(binding: "<Gamepad>/leftTrigger", processors="invert");
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// </remarks>
|
||||
public class InvertProcessor : InputProcessor<float>
|
||||
{
|
||||
/// <summary>
|
||||
/// Return the inverted value of <paramref name="value"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">Input value.</param>
|
||||
/// <param name="control">Ignored.</param>
|
||||
/// <returns>Invert value.</returns>
|
||||
public override float Process(float value, InputControl control)
|
||||
{
|
||||
return value * -1.0f;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
return "Invert()";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user