1
This commit is contained in:
25
Packages/Runtime/InputSystem/InputSystemExtensions.cs
Normal file
25
Packages/Runtime/InputSystem/InputSystemExtensions.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using System;
|
||||
namespace BITKit
|
||||
{
|
||||
public static partial class InputSystemExtensions
|
||||
{
|
||||
public static InputAction RegisterCallback(this InputAction self, Action<InputAction.CallbackContext> action)
|
||||
{
|
||||
self.performed += action;
|
||||
self.started += action;
|
||||
self.canceled += action;
|
||||
return self;
|
||||
}
|
||||
public static InputAction UnRegisterCallback(this InputAction self, Action<InputAction.CallbackContext> action)
|
||||
{
|
||||
self.performed -= action;
|
||||
self.started -= action;
|
||||
self.canceled -= action;
|
||||
return self;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user