# Navigation Samples
The Navigation Samples showcase various usages of the NavMesh. They contain eight samples:
1. Multiple Agent Sizes: Demonstrates how a different radius on an agent type can change the way agents navigate through the same scene.
2. Drop Plank: Demonstrates dynamically changing walkable paths by allowing the player to add walkable planks by pressing space.
3. Free Orientation: Demonstrates a controllable agent that can walk on a tilted plane.
4. Sliding Window Infinite: Demonstrates a controllable agent that can walk through a dynamically created world that gets updated to simulate infinity as the agent walks through it. The NavMesh is only built in some set bounds that follow the agent.
5. Sliding Window Terrain: Demonstrates a controllable agent that can walk through a terrain for which the NavMesh is only generated within a set distance of the agent.
6. Modify Mesh: Demonstrates agents walking aimlessly on planes whose mesh can be modified dynamically by the player.
7. Dungeon: Demonstrates a controllable agent that can walk through a maze generated from pre-baked tiles that connect to each other at runtime. The link traversal animation can be modified with some presets (teleport, normal speed, parabola, curve).
8. Height Mesh: Demonstrates two agents walking down stairs. The environment on the left uses `NavMeshSurface` with a Height Mesh which allows the agent to snap to each step in the stairs as it goes down. The environment on the right uses a `NavMeshSurface` with no Height Mesh; the agent simply slides down the stairs.
Note that some of these samples require that the `Packages/manifest.json` file of your project [references](https://docs.unity3d.com/Manual/upm-manifestPrj.html) the following default modules:
```
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0"
```
# Introduction to NavMesh
The Navigation package allows you to set up pathfinding AI in your Unity project. Two fundamental concepts of pathfinding are (1) agents and (2) world representation.
1. An agent is a game entity that travels autonomously between two points in a scene. In Unity, a GameObject can be turned into a navigation agent by adding a `NavMeshAgent` component to it.
2. World representation is what allows the pathfinding program of an agent to understand the traversable surfaces of a world. It is a simplification of a 3D world. In Unity, a traversable surface is represented as a mesh of polygons which we refer to as NavMesh.
To convert some or all of the geometry in your scene into a surface that is traversable by an agent, you can use the `NavMeshSurface` component. However, you must also generate the data of the `NavMeshSurface` by using the `Bake` button in the Inspector. The process of baking is what actually creates a representation of the geometry in your scene that agents and their pathfinding program can understand.
Whenever there are modifications done to the scene's geometry that can impact the navigation, the related `NavMeshSurface` component must be rebaked. The baking process is not done automatically because it can be a long process depending on the size and complexity of the input geometry. Note that baking cannot be done from the Inspector during Playmode.
In order for an agent to move, it must know its destination. In Unity, the destination of a `NavMeshAgent` can be set through code with the `destination` property or the `SetDestination()` method. You can find an example of this in the `ClickToMove` script.
For more information, refer to the [AI Navigation package manual](https://docs.unity3d.com/Packages/com.unity.ai.navigation@latest).
# Agent Types
The following agent types are created and used by the samples:
1. Name: Humanoid for Navigation Sample
Radius: 0.5
Height: 2.0
Step Height: 0.75
Max Slope: 45
2. Name: Ogre for Navigation Sample
Radius: 1.0
Height: 2.0
Step Height: 0.4
Max Slope: 36
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Squad Shooter 小队射手 Unity休闲放置射击游戏项目源码C# 支持Unity版本2022.3.16f1及以上 小队射手统一源代码。认识西瓜游戏的全新完整游戏。 这个完全可定制的射击游戏模板具有人工智能敌人、不同的武器、世界和角色。您下一次热门的完美起点! 我们的优势 详细文档 易于使用的工具 定制指南 简洁的结构和代码 小队射击游戏特点 敌人系统+定制 武器系统+定制 人物系统+定制 关卡编辑器: 舒适的工具 世界支持 详细文档 货币化: 阿德莫布 统一广告 IAP IOS/安卓优化
资源推荐
资源详情
资源评论
收起资源包目录
Squad Shooter 小队射手 Unity火柴人休闲放置射击游戏项目源码C# (2000个子文件)
Idle.anim 1.13MB
Shine Rotate.anim 800KB
Walking.anim 567KB
Jumping.anim 451KB
Target Ring Rotate.anim 404KB
Running.anim 301KB
Run_Backwards.anim 292KB
Run_Left.anim 290KB
Run_BackwardLeft.anim 288KB
Run_Right.anim 288KB
Run_ForwardRight.anim 286KB
Run_ForwardLeft.anim 276KB
Shot.anim 265KB
Shot Shotgun.anim 263KB
Run_BackwardRight.anim 249KB
Grunt.anim 223KB
Shot Idle.anim 195KB
Hit.anim 131KB
Arrow Idle.anim 99KB
Tutorial.anim 60KB
Notification Idle.anim 51KB
Chest_Shaking.anim 30KB
Chest_Open.anim 26KB
Pointer Top Down.anim 23KB
Pointer Idle.anim 22KB
Chest Idle.anim 20KB
Drop Idle.anim 10KB
Label Idle.anim 8KB
Idle.anim 7KB
Open.anim 6KB
Idle.anim 6KB
Alert.anim 5KB
UI Arrow Idle.anim 5KB
RV Chest Button Hide.anim 5KB
RV Chest Button Show.anim 5KB
Minigun Idle.anim 1KB
FredokaOne-Regular SDF.asset 2.03MB
ProjectSettings.asset 25KB
InputManager.asset 10KB
NavMesh-NavMesh Land.asset 6KB
Stars Flight Data.asset 3KB
Custom UI Particle Settings.asset 3KB
GraphicsSettings.asset 3KB
MaintainerSettings.asset 2KB
QualitySettings.asset 2KB
Physics2DSettings.asset 2KB
Global Volume Profile.asset 1KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
MemorySettings.asset 1KB
EditorSettings.asset 1KB
PackageManagerSettings.asset 1003B
UnityConnectSettings.asset 943B
TagManager.asset 511B
EditorBuildSettings.asset 497B
ShaderGraphSettings.asset 489B
URPProjectSettings.asset 410B
AudioManager.asset 360B
VFXManager.asset 308B
TimeManager.asset 202B
VersionControlSettings.asset 188B
XRSettings.asset 158B
PresetManager.asset 146B
ClusterInputManager.asset 114B
Unity.AI.Navigation.Samples.Initialization.Editor.csproj.AssemblyReference.cache 123KB
Unity.VisualScripting.Core.Editor.csproj.AssemblyReference.cache 111KB
Unity.VisualScripting.Core.csproj.AssemblyReference.cache 106KB
Unity.AI.Navigation.Samples.csproj.AssemblyReference.cache 106KB
Assembly-CSharp.csproj.AssemblyReference.cache 104KB
Assembly-CSharp.Player.csproj.AssemblyReference.cache 97KB
Assembly-CSharp-Editor.csproj.AssemblyReference.cache 85KB
Unity.Searcher.Editor.csproj.AssemblyReference.cache 73KB
Unity.PlasticSCM.Editor.csproj.AssemblyReference.cache 73KB
DesignTimeResolveAssemblyReferencesInput.cache 41KB
Unity.AI.Navigation.Samples.Player.csproj.AssemblyReference.cache 25KB
Unity.InputSystem.Player.csproj.AssemblyReference.cache 25KB
Unity.VisualScripting.Core.Player.csproj.AssemblyReference.cache 25KB
Unity.Timeline.Player.csproj.AssemblyReference.cache 25KB
Unity.Timeline.csproj.AssemblyReference.cache 6KB
Unity.Burst.CodeGen.csproj.AssemblyReference.cache 3KB
Cinemachine.Player.csproj.AssemblyReference.cache 845B
Cinemachine.csproj.AssemblyReference.cache 845B
Unity.Burst.Player.csproj.AssemblyReference.cache 392B
Unity.Burst.csproj.AssemblyReference.cache 392B
Unity.TextMeshPro.Editor.csproj.AssemblyReference.cache 11B
Unity.VSCode.Editor.csproj.AssemblyReference.cache 11B
UnityEditor.TestRunner.csproj.AssemblyReference.cache 11B
Unity.InputSystem.ForUI.csproj.AssemblyReference.cache 11B
com.unity.cinemachine.editor.csproj.AssemblyReference.cache 11B
Unity.Mathematics.csproj.AssemblyReference.cache 11B
Unity.Timeline.Editor.csproj.AssemblyReference.cache 11B
Unity.VisualScripting.Flow.Player.csproj.AssemblyReference.cache 11B
Unity.AI.Navigation.Editor.csproj.AssemblyReference.cache 11B
Unity.InputSystem.csproj.AssemblyReference.cache 11B
Character Animator Controller.controller 37KB
Boss Animator Controller.controller 24KB
Range Enemy Animator Controller.controller 18KB
Sniper Enemy Animator.controller 15KB
Melee Enemy Animator Controller.controller 9KB
Chest Animator Controller.controller 6KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- ylgamer2024-04-10资源简直太好了,完美解决了当下遇到的难题,这样的资源很难不支持~
小云同志你好
- 粉丝: 1051
- 资源: 999
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功