34 lines
779 B
C#
34 lines
779 B
C#
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
namespace AsteroidGame.Handlers
|
|
{
|
|
public class HandlerBase : MonoBehaviour
|
|
{
|
|
|
|
private HandlerControls _handlerControls;
|
|
|
|
private void Awake()
|
|
{
|
|
_handlerControls = new HandlerControls();
|
|
}
|
|
|
|
protected virtual void OnEnable()
|
|
{
|
|
_handlerControls.Player.Enable();
|
|
_handlerControls.Player.Click.performed += OnClick;
|
|
}
|
|
|
|
protected virtual void OnDisable()
|
|
{
|
|
_handlerControls.Player.Click.performed -= OnClick;
|
|
_handlerControls.Player.Disable();
|
|
}
|
|
|
|
protected virtual void OnClick(InputAction.CallbackContext a)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|