返回介绍

PointEffector2D 2D点效果器

发布于 2019-12-18 15:38:19 字数 2647 浏览 954 评论 0 收藏 0

class in UnityEngine/Inherits from: Effector2D

Description 描述

Applies forces to attract/repulse against a point.

应用力去吸引/击退攻击一个点。

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.

当源2D碰撞器触发,该效应器将会应用力到目标2D碰撞器与源碰撞器重叠部分。当源2D碰撞器不触发时,效应器将会仅应用力到目2D碰撞器接触的部分。

This effector is designed primarily to work with source Collider2D that are set as triggers so that target Collider2D can overlap the defined area.

该效应器设计首要作用于源2D碰撞器,设置作为触发器因此目标2D碰撞器可以与定义区域重叠。

Variables 变量

angularDragThe angular drag to apply to rigid-bodies.
应用于刚体的角度阻力。
distanceScaleThe scale applied to the calculated distance between source and target.
该缩放应用于计算原点与目标点之间的距离。
dragThe linear drag to apply to rigid-bodies.
应用于刚体的线性阻力。
forceMagnitudeThe magnitude of the force to be applied.
应用的力的大小。
forceModeThe mode used to apply the effector force.
该模式用来施加效应器力。
forceSourceThe source which is used to calculate the centroid point of the effector. The distance from the target is defined from this point.
来源是指用来计算效应器的质心点。距离目标是从这点定义。
forceTargetThe target for where the effector applies any force.
效应器施加任何力的目标。
forceVariationThe variation of the magnitude of the force to be applied.
0和forceVariation 之间的随机值被使用并且添加力的大小。forceVariation 可以是负数去随意减少力的大小。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文