[Unity3D]Node-Canvas入门案例

NodeCanvas是完整的基于节点的 Unity 视觉行为创作框架,能够在直观的视觉节点编辑器中创建高级 AI 行为和逻辑,能够在游戏中为角色或npc配置相应的ai行为。详细内容可以参考官方文档

本文给出一个node-canvas的入门案例,用于快速理解node-canvas的使用方法。

例子 小球追逐方块

这个例子是Node_Canvas的一个简单应用,使用了包括行为树中的action、condition、sequence以及filter等元件,通过这个demo的学习入门node-canvas。

首先将node-canvas插件所需要的包导入到工程,直接拖动整个文件夹放入建立好的工程下的package文件夹中即可自动导入,在使用过程中就能够直接使用这个包中的内容。

在SampleScene中插入所需要的物体,如cubu和sphere等。

对所需要加入行为树的物件使用Add Component,加入Behaviour Tree Owner,这个操作会默认加入两个部件即Behaviour Tree Owner和Blackboard,之后的编程都会在blackboard上进行。加入好后,点击Behaviour Tree Owner下的CREATE NEW,并点击bound,则会创建可编辑的canvas。

 这个例子将会实现在平板上放置一个方块以及多个小球,玩家可移动方块,当方块进入到小球的辐射范围的

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值