r2mods/ilspy_dump/ror2_csproj/RoR2/InputResponse.cs

28 lines
442 B
C#

using Rewired;
using UnityEngine;
using UnityEngine.Events;
namespace RoR2;
public class InputResponse : MonoBehaviour
{
public string[] inputActionNames;
public UnityEvent onPress;
private void Update()
{
foreach (Player player in ReInput.players.Players)
{
for (int i = 0; i < inputActionNames.Length; i++)
{
if (player.GetButtonDown(inputActionNames[i]))
{
onPress?.Invoke();
break;
}
}
}
}
}