示例#1
0
 public void Detection()
 {
     Collider[] overlaps = _detectionRadius.OverlapSphere(playerLayer);
     foreach (Collider overlap in overlaps)
     {
         _player = overlap.GetComponentInParent <Actor>();
     }
 }
示例#2
0
文件: Trigger.cs 项目: ModernMAK/BoEG
 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()
     });