Unity NodeCanvas插件 FSM状态机 文档翻译+使用分享(1)

本文介绍了NodeCanvas中的状态机(FSM),包括其包含的有限状态、状态激活时的任务执行、传出转换的条件驱动以及连续检查和状态完成后检查两种模式。强调了转换顺序的重要性,因为一次只能发生一次状态转移。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

State Machines 状态机

States 状态

一个FSM(状态机)包含的有限数量的状态,FSM可以在任意时间处于这些状态。当状态被激活,每个状态都会执行一个特定的任务或多个动作任务。当一个状态处于活动状态时,它的所有传出转换要么每帧计算一次,要么在状态结束后计算一次,只要这些条件中的任何一个为真,转换就会发生,结果是当前状态被禁用,新状态被启用。一帧内只能发生一次过渡。

Transitions 转换

FSM中的每个状态都可以有传出转换。在NodeCanvas中,转换是基于条件的,这意味着每个转换评估都基于一个或多个可以分配给该转换的条件任务。另外,没有指定任何条件的转换被称为“OnFinish”转换,顾名思义,只有在状态结束后才会保持正确。当您在一个状态中有多个传出转换时,您可以优先考虑通过状态的Inspector GUI评估它们的顺序。这显然很重要,因为一次只能发生一次转换。默认情况下,每帧计算一次转换,但也有一个选项,只在状态结束后计算一次转换。在状态的inspector面板上可以找到这两个选项,分别名为 “Check Continuously” (the default)“”连续检查“ 和 “Check After State Finished”“状态完成后检查”。

原文链接

The complete Visual Behaviour Authoring framework for Unity, empowering you to create advanced AI Behaviours and Logic, including three separate, fully featured, yet seamlessly interchangeable modules for you to choose and easily add in your game: • Behaviour Trees • Hierarchical State Machines • Dialogue Trees NodeCanvas is a production ready framework used by many awesome games including Kim, Pamela, Hurtworld, Shroud of the Avatar, Kingdom and Ghost of a Tale. [Games Showcase] Feature Highlights ------------------------------------- • Choose the right tool for the task at hand. • Design reactive Behaviour Trees and Hierarchical State Machines within an intuitive, designer friendly visual node editor: (Full Undo/Redo, Zoom In/Out, Multi-selection, Duplication, Copy/Pasting, JSON Import/Export, Groups, Comments and more) • Use local & global variables of any type, visually or in code, for creating reusable and actor-oriented, parametric behaviours, optionally saving and loading those variables between gaming sessions. • Data Bind variables with any component property of any type directly. • Sync variables automatically over the network using UNET, for creating multiplayer games. • Visually Debug behaviours with realtime, colorful and informative runtime debugging. • Live Edit everything while in play mode to perfectly understand your design goals and how to achieve them. • Utilize any existing code directly with advanced and extremely fast Reflection Tasks, automatically integrating Unity's and 3rd Party asset APIs. • Work with Lists/Arrays, Enums, Interfaces and pretty much ANY Variable Type you need out-of-the-box. • React to world changes and transfer data using the built-in Event System. • Reuse and Bind made behaviours among any number of different agents. • Organize your designs using Behaviour Sub-Trees and Sub-State Machines. • Extend NodeCanvas Framework to create your own Actions, Conditions, Nodes or even completely new modules with the e
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值