pub struct AreaEffector2D {
pub m_AngularDrag: f32,
pub m_ColliderMask: BitField,
pub m_Drag: f32,
pub m_Enabled: u8,
pub m_ForceMagnitude: f32,
pub m_ForceTarget: i32,
pub m_ForceVariation: f32,
pub m_GameObject: PPtr,
pub m_ForceAngle: Option<f32>,
pub m_ForceDirection: Option<f32>,
pub m_UseColliderMask: Option<bool>,
pub m_UseGlobalAngle: Option<bool>,
}Expand description
AreaEffector2D is a class of the Unity engine since version 5.0.0f4. Exert from Unity’s scripting documentation: Applies forces within an area. When the source Collider2D is a trigger, the effector will apply forces whenever the target Collider2D overlaps the source. When the source Collider isn’t a trigger, the effector will apply forces whenever the target Collider2D is in contact with the source only.This effector is designed primarily to work with source Collider2D that are set as triggers so that target Collider2D can overlap the defined area.
Fields§
§m_AngularDrag: f32The angular drag to apply to rigid-bodies.
m_ColliderMask: BitFieldThe mask used to select specific layers allowed to interact with the effector.
m_Drag: f32The linear drag to apply to rigid-bodies.
m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_ForceMagnitude: f32The magnitude of the force to be applied.
m_ForceTarget: i32The target for where the effector applies any force.
m_ForceVariation: f32The variation of the magnitude of the force to be applied.
m_GameObject: PPtrThe game object this component is attached to. A component is always attached to a game object.
PPtr<GameObject>: (5.0.0f4 - 2022.3.2f1)
m_ForceAngle: Option<f32>The angle of the force to be applied. f32: (5.0.2f1 - 2022.3.2f1)
m_ForceDirection: Option<f32>f32: (5.0.0f4 - 5.0.1f1)
m_UseColliderMask: Option<bool>Should the collider-mask be used or the global collision matrix? bool: (5.0.2f1 - 2022.3.2f1)
m_UseGlobalAngle: Option<bool>Should the forceAngle use global space? bool: (5.0.2f1 - 2022.3.2f1)