Input Action Released this Frame#
Input / Input Action Released this Frame
Can Read
Cannot Write
Description#
Returns true the frame the specified Input Action is released
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Input Action Released this Frame")]
[Category("Input/Input Action Released this Frame")]
[Description("Returns true the frame the specified Input Action is released")]
[Image(typeof(IconBoltOutline), ColorTheme.Type.Teal, typeof(BadgeArrowUp))]
[Keywords("Button", "Key", "Up", "Just", "Cancel")]
[Serializable]
public class TypeBoolInputActionReleaseThisFrame : TypeBool
{
[SerializeField] private InputActionFromAsset m_InputAction = new InputActionFromAsset();
public override bool Get(Args args)
{
UnityEngine.InputSystem.InputAction inputAction = this.m_InputAction.InputAction;
return inputAction?.WasReleasedThisFrame() ?? false;
}
public override string ToString()
{
return $"Released {this.m_InputAction}";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}