一键导入
navmesh
Unity navigation — NavMeshAgent configuration, NavMeshSurface, off-mesh links, dynamic obstacles, pathfinding patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Unity navigation — NavMeshAgent configuration, NavMeshSurface, off-mesh links, dynamic obstacles, pathfinding patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
DOTween animation library — sequence composition, tween lifecycle, easing, kill strategies. CRITICAL: Always kill tweens in OnDestroy to prevent leaks and errors.
Dialogue tree patterns — ScriptableObject graph, node types (text, choice, condition, event), typewriter effect, localization-ready. Load when implementing NPC conversations.
Generic state machine patterns — IState interface, StateMachine<T>, game state management (menu/gameplay/pause), enemy AI states, hierarchical FSM. Load when implementing state-driven behavior.
2D platformer architecture — tight controls (coyote time, input buffer, variable jump), level design patterns, collectibles, checkpoints, hazards, boss patterns.
Unity physics — non-allocating queries, collision layers, FixedUpdate discipline, continuous collision detection, character controllers, joints.
How the atomic instinct learning system works — observations, distillation, confidence scoring, project vs global scope, and promotion/evolution workflows.
| name | navmesh |
| description | Unity navigation — NavMeshAgent configuration, NavMeshSurface, off-mesh links, dynamic obstacles, pathfinding patterns. |
| globs | ["**/*Nav*.cs","**/*Pathfind*.cs","**/*Agent*.cs"] |
NavMeshSurface component to environment parent objectNavMeshAgent to moving characters[SerializeField] private NavMeshAgent _agent;
private void Awake()
{
_agent = GetComponent<NavMeshAgent>();
_agent.speed = 3.5f;
_agent.acceleration = 8f;
_agent.angularSpeed = 120f;
_agent.stoppingDistance = 0.5f;
_agent.autoBraking = true;
}
public void MoveTo(Vector3 destination)
{
_agent.SetDestination(destination);
}
private void Update()
{
if (_agent.pathPending) return; // Still calculating
switch (_agent.pathStatus)
{
case NavMeshPathStatus.PathComplete:
// Full path found
break;
case NavMeshPathStatus.PathPartial:
// Can only get partway — obstacle or unreachable
break;
case NavMeshPathStatus.PathInvalid:
// No path possible
break;
}
// Check if arrived
if (!_agent.pathPending && _agent.remainingDistance <= _agent.stoppingDistance)
{
// Arrived at destination
}
}
public sealed class PatrolBehavior : MonoBehaviour
{
[SerializeField] private Transform[] _waypoints;
[SerializeField] private float _waitTime = 2f;
private NavMeshAgent _agent;
private int _currentWaypoint;
private float _waitTimer;
private void Update()
{
if (_agent.pathPending) return;
if (_agent.remainingDistance <= _agent.stoppingDistance)
{
_waitTimer -= Time.deltaTime;
if (_waitTimer <= 0f)
{
_currentWaypoint = (_currentWaypoint + 1) % _waypoints.Length;
_agent.SetDestination(_waypoints[_currentWaypoint].position);
_waitTimer = _waitTime;
}
}
}
}
For jumps, ladders, teleporters — connections between disconnected NavMesh areas.
NavMeshLink component between two points// Rebake at runtime (e.g., after terrain change)
_navMeshSurface.BuildNavMesh();
// Or update only:
_navMeshSurface.UpdateNavMesh(_navMeshSurface.navMeshData);
_agent.SetAreaCost(areaIndex, cost)