using System; using UnityEngine; public class PlayerAttack : MonoBehaviour { private Animate _animate; private InputManager _inputManager; private LayerMask _enemyLayermask; public void initialize(InputManager inputManager, LayerMask enemyLayermask, Animate animate) { _inputManager = inputManager; _enemyLayermask = enemyLayermask; _animate = animate; } public void Attack() { if (_inputManager.attackPerformed) { _animate.TriggerAnimation("Attack"); } } }