Exemplo n.º 1
0
 public void Detection()
 {
     Collider[] overlaps = _detectionRadius.OverlapSphere(playerLayer);
     foreach (Collider overlap in overlaps)
     {
         _player = overlap.GetComponentInParent <Actor>();
     }
 }
Exemplo n.º 2
0
 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()
     });