文档

Unity Engine

Unity Engine

isTrigger

Whether the shape is a trigger.
阅读时间1 分钟最后更新于 3 天前

Definition

  • Type: Property
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public bool isTrigger { get; set; }

Remarks

A trigger shape doesn't collide with other shapes. Other shapes pass through it instead, and Unity reports the overlap to an PhysicsCallbacks.ITriggerCallback when PhysicsShape.triggerEvents is
true
. Changing the state here is relatively expensive and should be avoided. See PhysicsShapeDefinition.isTrigger.