找回密码
 立即注册
搜索

[编辑器/功能拓展] SensorToolkit 2 2.0.3触发碰撞器

[复制链接]
91 |0
发表于 2023-8-23 15:29:49 | 显示全部楼层 |阅读模式
























SensorToolkit is a powerful abstraction over the built-in Unity functions like Raycasts, Overlaps and Trigger Colliders. You can add standalone sensor components to your game objects and configure them as needed. The sensors can be queried to determine what they detect and provide additional information, such as the visibility or shape of the target.

Features:
• Works in both 2D and 3D.
• Many sensor types available: Raycasting, Overlaps, Steering, Line of Sight and more.
• Lightweight and modular. Sensors are independent components that feel native to Unity.
• Easy to integrate with your project: simply add a sensor component and configure it.
• Flexible and unopinionated, allowing you to design your game as desired.
• Many filtering options and querying functions for precise detection.
• Capable of detecting individual colliders or rigid bodies made up of multiple colliders.
• Advanced line-of-sight implementation can calculate partial visibility.
• Performance is a key focus, with many options available to control performance.
• Test sensors in the editor and confirm their configurations before running the game.
• Upgraded steering behaviour based on 'Context-Based Steering' method.
• All source code is included.
• Zero garbage generated.

Who is this for:
SensorToolkit is designed to be user-friendly and easy to use, regardless of your level of programming experience. Non-programmers will appreciate the ability to create complex detection behaviors without writing code, as the kit is integrated with Playmaker and additional integrations are planned. Programmers will find SensorToolkit to be a powerful foundation for building AI behaviors, as it manages the complexities of object detection and provides a clean and simple interface. The widgets and debugging inspectors also help you quickly identify any configuration issues, allowing you to reduce boilerplate and keep your code lean and neat.

Integrations:
- Playmaker
- Behavior Designer
- Game Creator 2
- Adventure Creator
- AI Tree

Difference from v1:
This is a significant update from the first version of SensorToolkit. While it may seem familiar, there are a significant number of changes. The first version's code was difficult to extend, making it hard to add new sensors or extend existing ones without blowing out complexity. SensorToolkit 2, on the other hand, has a new architecture and philosophy that makes it easier to add new features. Some of the major new features include:
• Sensors capture the bounding box of detected objects, allowing for easy targeting of an object's center of mass.
• Ray sensor supports all Physics.Raycast shapes including 'ray', 'sphere', 'box' and 'capsule'.
• Range sensor supports all Physics.Overlap shapes including 'sphere', 'box' and 'capsule'.
• Sensors do not implement the 'Update' method, meaning that if a sensor is not pulsing, it has no performance impact when this function is called each frame. This is especially useful for the TriggerSensor, allowing you to create many static trigger zones with good scalability while still being able to use the toolkit's comprehensive API.
• Line of Sight is now a separate sensor. It's been significantly extended, including the ability to smooth visibility scores over multiple frames, so it's possible to calculate fractional visibility using a single ray per pulse. It can scale visibility by distance and view angle so it's no longer necesassary to use a FOVCollider.
• Sensor pulses are randomly staggered so they don't fall on the same frame when they have the same pulse interval.
• Steering sensor that replaces the old Steering Rig and is based on the more advanced "Context Based Steering" method, which should work better and be easier to use.
• New arc sensor that allows for raycasts over a parabola.
• New boolean sensor lets you combine the results of multiple other sensors. For example: 'What are the things that I can hear and also see'.
• Ability to inject custom code into sensor detection logic for custom filtering needs.
• New Navmesh sensor for analyzing a navmesh.
• More robust codebase that has eliminated all outstanding bugs.


SensorToolkit是内置Unity功能(如光线投射、重叠和触发碰撞器)的强大抽象。你可以将独立的传感器组件添加到游戏对象中,并根据需要进行配置。可以对传感器进行查询,以确定它们检测到什么,并提供额外的信息,如目标的可见度或形状。

特点:
•工作在2D和3D。
•许多传感器类型可用:光线投射,重叠,转向,视线等。
•轻量级和模块化。传感器是Unity原生的独立组件。
•易于与您的项目集成:只需添加一个传感器组件并配置它。
•灵活且无偏见,允许你按照自己的意愿设计游戏。
•许多过滤选项和查询功能,精确检测。
•能够检测单个碰撞器或由多个碰撞器组成的刚体。
•先进的视线实现可以计算部分能见度。
•性能是一个关键的焦点,有许多选项可用于控制性能。
•在运行游戏之前,在编辑器中测试传感器并确认其配置。
•基于“基于上下文的转向”方法的升级转向行为。
•包含所有源代码。
•零垃圾产生。

这是给谁的?
SensorToolkit设计为用户友好且易于使用,无论您的编程经验水平如何。非程序员将欣赏无需编写代码即可创建复杂检测行为的能力,因为该工具包与Playmaker集成,并且计划进行其他集成。程序员会发现SensorToolkit是构建人工智能行为的强大基础,因为它管理对象检测的复杂性,并提供干净简单的界面。小部件和调试检查器还可以帮助您快速识别任何配置问题,使您能够减少样板文件并保持代码的精简和整洁。

集成:
——组织核心
-行为设计师
-游戏创造者2
-冒险创造者
- AI树

与v1的区别:
这是对第一版SensorToolkit的重大更新。虽然看起来很熟悉,但有很多变化。第一个版本的代码很难扩展,因此很难添加新的传感器或扩展现有的传感器而不增加复杂性。另一方面,SensorToolkit 2有一个新的架构和理念,可以更容易地添加新功能。一些主要的新功能包括:
•传感器捕获被检测物体的边界框,允许轻松瞄准物体的质心。
•光线传感器支持所有物理。光线投射形状包括“射线”,“球体”,“盒子”和“胶囊”。
•范围传感器支持所有物理。重叠的形状包括“球体”、“盒子”和“胶囊”。
•传感器不实现'Update'方法,这意味着如果传感器没有脉冲,当每帧调用此函数时,它不会对性能产生影响。这对于TriggerSensor特别有用,它允许您创建许多具有良好可伸缩性的静态触发区域,同时仍然能够使用工具包的综合API。
•视线现在是一个单独的传感器。它得到了显著的扩展,包括平滑多帧可见性分数的能力,因此可以使用每个脉冲的单射线计算分数可见性。它可以根据距离和视角缩放可见性,所以不再需要使用FOVCollider。
•传感器脉冲随机交错,所以当它们有相同的脉冲间隔时,它们不会落在同一帧上。
•转向传感器,取代旧的转向钻机,并基于更先进的“基于上下文的转向”方法,这应该工作得更好,更容易使用。
•新的电弧传感器,允许光线投射在抛物线上。
•新的布尔传感器,让您结合多个其他传感器的结果。例如:“我能听到和看到的东西是什么?”
•能够注入自定义代码到传感器检测逻辑自定义过滤需求。
•新的Navmesh传感器,用于分析导航网格。
•更健壮的代码库,消除了所有突出的bug。





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表