twinStick/twinStickCrawler/Assets/Scripts/Creatures/Player/PlayerAttack.cs

24 lines
560 B
C#
Raw Normal View History

using System;
using UnityEngine;
public class PlayerAttack : MonoBehaviour
{
2024-12-20 14:21:20 +00:00
private Animate _animate;
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-20 14:21:20 +00:00
_inputManager = inputManager;
_enemyLayermask = enemyLayermask;
2024-12-20 14:21:20 +00:00
_animate = animate;
}
public void Attack()
{
2024-12-20 14:21:20 +00:00
if (_inputManager.attackPerformed)
{
_animate.TriggerAnimation("Attack");
}
}
}