Global Game Jam 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
591 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.InputSystem;
  5. public abstract class InputBehaviour : MonoBehaviour
  6. {
  7. protected PlayerData m_data;
  8. public virtual void Initialise(PlayerData data)
  9. {
  10. this.m_data = data;
  11. RegisterInput(data.Input);
  12. }
  13. protected virtual void OnDestroy()
  14. {
  15. if (m_data != null)
  16. UnregisterInput(m_data.Input);
  17. }
  18. public abstract void RegisterInput(PlayerInput playerInput);
  19. public abstract void UnregisterInput(PlayerInput playerInput);
  20. }