class in UnityEngine/Inherits from: Effector2D
Description 描述
適用“平台”的行為,比如單向碰撞等。
當源Collider2D 時個觸發器時,該效應器每當源重疊時應用力到目標Collider2D 。當源碰撞器不是觸發器時,僅當該效應器接觸源碰撞器時應用力。
1、這個Platform Effector 2D是用來做橫版2D游戲從下往上跳而不被阻擋的那種跳躍平台用的。
2、這個組件要配合其他2D 碰撞器使用,例如:再添加一個2D Box Collider,然后勾選 Used By Effector即可。
3、Use One Way 只允許單方向碰撞,若要做跳躍平台的話必須勾選。
4、Use One Way Groupping 如果你的跳躍平台擺得很緊密的話,為了防止Bug,必須勾選這個,它會自動將臨近的算為一個組
5、Surface Arc就是允許碰撞的角度,如果設為180的話,那么從左邊和右邊水平靠近平台的移動都會受到碰撞。如果要做上面提到的跳躍平台的話,用90即可。
Variables 變量
sideArc | The angle of an arc that defines the sides of the platform centered on the local 'left' and 'right' of the effector. Any collision normals within this arc are considered for the 'side' behaviours. 弧形的角度指定義在以效應器自身“左”和“右”上的平台的兩側。任何碰撞法線在該弧形內部認為是該“側面”的行為。 |
surfaceArc | The angle of an arc that defines the surface of the platform centered of the local 'up' of the effector. 弧形的角度定義集中在效應器自身上方的平台表面。 |
useOneWay | Should the one-way collision behaviour be used? 是否使用單向碰撞行為? |
useOneWayGrouping | Ensures that all contacts controlled by the one-way behaviour act the same. 確保所有通過單向接觸控制行為相同。 |
useSideBounce | Should bounce be used on the platform sides? 在平台側面是否使用反彈? |
useSideFriction | Should friction be used on the platform sides? 是否應該在平台側面使用摩擦力? |