48 lines
859 B
C#
48 lines
859 B
C#
using Managers;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
using static InputActionMaps;
|
|
|
|
public class GameplayMetaInputEvents : MonoBehaviour, IMetaActions
|
|
{
|
|
private InputActionMaps inputActions;
|
|
|
|
void Awake()
|
|
{
|
|
inputActions = new InputActionMaps();
|
|
inputActions.Meta.SetCallbacks(this);
|
|
inputActions.Meta.Enable();
|
|
}
|
|
|
|
public void OnStart(InputAction.CallbackContext context)
|
|
{
|
|
if (context.performed)
|
|
MatchManager.G.StartPressed();
|
|
}
|
|
|
|
public void OnPause(InputAction.CallbackContext context)
|
|
{
|
|
if (context.performed)
|
|
MatchManager.G.PausePressed();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
inputActions.Meta.Disable();
|
|
inputActions.Meta.RemoveCallbacks(this);
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
Dispose();
|
|
}
|
|
|
|
public void OnReset(InputAction.CallbackContext context)
|
|
{
|
|
#if DEBUG
|
|
MatchManager.G.ResetMatch();
|
|
#endif
|
|
return;
|
|
}
|
|
}
|