웅냥
This commit is contained in:
@@ -8,11 +8,13 @@ namespace Unicorn.Player
|
||||
protected override void OnDamaged(DamageInfo info)
|
||||
{
|
||||
Debug.Log(health);
|
||||
base.OnDamaged(info);
|
||||
}
|
||||
|
||||
protected override void OnDeath()
|
||||
{
|
||||
Debug.Log("주것서영.");
|
||||
base.OnDeath();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ namespace Unicorn.Player
|
||||
{
|
||||
public GameObject attackHitbox;
|
||||
private UnicornInputSystem _unicornInput;
|
||||
private bool _attackAvailable = true;
|
||||
private void Start()
|
||||
{
|
||||
_unicornInput = UnicornInput.Unicorn;
|
||||
@@ -22,14 +23,18 @@ namespace Unicorn.Player
|
||||
|
||||
private void Attack(InputAction.CallbackContext obj)
|
||||
{
|
||||
if (!_attackAvailable) return;
|
||||
StartCoroutine(OnAttack());
|
||||
}
|
||||
|
||||
private IEnumerator OnAttack()
|
||||
{
|
||||
_attackAvailable = false;
|
||||
attackHitbox.SetActive(true);
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
attackHitbox.SetActive(false);
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
_attackAvailable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user