返回介绍

PlatformEffector2D.useOneWayGrouping 使用单向组

发布于 2019-12-18 15:38:18 字数 1744 浏览 1021 评论 0 收藏 0

JavaScript => public var useOneWayGrouping: bool;
C# => public bool useOneWayGrouping;

Description 描述

Ensures that all contacts controlled by the one-way behaviour act the same.

确保所有通过单向接触控制行为相同。

When using the oneWay behaviour, each individual collider that comes into contact with the PlatformEffector2D is checked to see if it should be disabled or not by comparing its collision normal to the surfaceArc. Working on each individual collider like this can cause problems on objects that are comprised of multiple colliders.

当使用单向行为,每个对撞机检查接触PlatformEffector2D ,看它是否应该被禁用或不通过比较其碰撞surfaceArc正常。像这样每个单独碰撞器在多重碰撞器中工作可能导致问题。

If an object is comprised of many colliders and one of them has a contact disabled due to the one-way behaviour then it may be preferable to do the same for all colliders on the same object should they come into contact with the same PlatformEffector2D. To do this, set the useOneWayGrouping to true. When you do this, all colliders essentially act as one, all following each other with regards to the one-way behaviour.

如果对象由许多碰撞器组成,其中之一已禁用单向行为接触它可能更可取为同一对象上的所有碰撞器做的一样他们应该接触同一 PlatformEffector2D。为此,请将useOneWayGrouping 设置为true。当你这样做时,所有碰撞器本质行为一样,所有跟随将视为单向行为。

When the useOneWayGrouping is not enabled, an object comprised of multiple colliders could end up in a situation where it has one collider contact disabled by passing through the one-way platform, but have others not able to pass through.

当useOneWayGrouping没有启用时,一个对象包含多个碰撞器可能在一种情况下结束,当它有一个通过单向平台,碰撞器接触禁用,但是其他碰撞器没有能力区通过。

platformeffector2d

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

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

发布评论

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