Skip to content

Instantly share code, notes, and snippets.

@FREEZX
Created January 28, 2020 10:37
Show Gist options
  • Save FREEZX/4deb1efa7b48943ee36ce8adb82a267d to your computer and use it in GitHub Desktop.
Save FREEZX/4deb1efa7b48943ee36ce8adb82a267d to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using Doozy.Engine.UI.Base;
using Rewired;
using Sirenix.OdinInspector;
using UnityEngine;
public class RewiredToUIAction : MonoBehaviour
{
public UIAction Action;
[ActionIdProperty(typeof(RewiredConsts.Action))]
public int ActionId;
[PlayerIdProperty(typeof(RewiredConsts.Player))]
public int PlayerId;
// Update is called once per frame
void Update()
{
if(ReInput.players.GetPlayer(PlayerId).GetButtonDown(ActionId))
{
Debug.Log(ActionId);
Action.Invoke(gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment