Walls + Start Arrow
This commit is contained in:
parent
7da33be977
commit
33467f6cc4
71 changed files with 4255 additions and 81 deletions
18
Assets/Scripts/UnitScripts/Attacks/AttackSkeleton.cs
Normal file
18
Assets/Scripts/UnitScripts/Attacks/AttackSkeleton.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class AttackSkeleton : AttackHandler
|
||||
{
|
||||
[SerializeField] private GameObject arrowPrefab;
|
||||
[SerializeField] private float arrowBaseSpeed;
|
||||
[SerializeField] private Transform spawnPos;
|
||||
public override bool Attack()
|
||||
{
|
||||
if (_timer > 0) return false;
|
||||
|
||||
GameObject arrow = Instantiate(arrowPrefab, spawnPos.position, spawnPos.rotation);
|
||||
ArrowHandler arrowHandler = arrow.GetComponent<ArrowHandler>();
|
||||
arrowHandler.LaunchArrow(arrowBaseSpeed * spawnPos.forward);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue