2024-12-19 19:21:36 +00:00
|
|
|
using System;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class PlayerAttack : MonoBehaviour
|
|
|
|
{
|
2024-12-20 14:21:20 +00:00
|
|
|
private Animate _animate;
|
2024-12-19 19:21:36 +00:00
|
|
|
private InputManager _inputManager;
|
|
|
|
private LayerMask _enemyLayermask;
|
2024-12-20 14:21:20 +00:00
|
|
|
public void initialize(InputManager inputManager, LayerMask enemyLayermask, Animate animate)
|
2024-12-19 19:21:36 +00:00
|
|
|
{
|
2024-12-20 14:21:20 +00:00
|
|
|
_inputManager = inputManager;
|
2024-12-19 19:21:36 +00:00
|
|
|
_enemyLayermask = enemyLayermask;
|
2024-12-20 14:21:20 +00:00
|
|
|
_animate = animate;
|
2024-12-19 19:21:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Attack()
|
|
|
|
{
|
2024-12-20 14:21:20 +00:00
|
|
|
if (_inputManager.attackPerformed)
|
|
|
|
{
|
|
|
|
_animate.TriggerAnimation("Attack");
|
|
|
|
}
|
2024-12-19 19:21:36 +00:00
|
|
|
}
|
|
|
|
}
|