Created
January 28, 2020 10:37
-
-
Save FREEZX/4deb1efa7b48943ee36ce8adb82a267d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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