void Attack2()
{
var hits = Physics.OverlapSphere(AttackPoint.position, 0.5f);
foreach (var hit in hits)
{
var hitables = hit.GetComponent(typeof(IHitable));
if (hitables == null)
return;
foreach(IHitable hitable in hitables)
hitable.Hit();
Debug.Log(hit.name);
}
}
- List item