public void Detection() { Collider[] overlaps = _detectionRadius.OverlapSphere(playerLayer); foreach (Collider overlap in overlaps) { _player = overlap.GetComponentInParent <Actor>(); } }
public Collider[] OverlapCollider() { return(_shape switch { PhysicsShape.Sphere => _sphereCollider.OverlapSphere(), PhysicsShape.Box => _boxCollider.OverlapBox(), PhysicsShape.Capsule => _capsuleCollider.OverlapCapsule(), PhysicsShape.Invalid => throw new NotSupportedException(), _ => throw new ArgumentOutOfRangeException() });