/// --------------------------------------------- /// Shared Add-On for Behavior Designer Pro /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.AddOns.Shared.Demo { using UnityEngine; using UnityEngine.AI; /// /// Implements IPathfindingAgent for the NavMeshAgent. /// public class NavMeshPathfindingAgent : MonoBehaviour, IPathfindingAgent { private NavMeshAgent m_NavMeshAgent; /// /// Initializes the default values. /// private void Awake() { m_NavMeshAgent = GetComponent(); } /// /// Warps the pathfinding implementation. /// /// The target position. public void Warp(Vector3 position) { m_NavMeshAgent.Warp(position); } /// /// Sets the target destination. /// /// The position that should be set. public void SetDestination(Vector3 position) { m_NavMeshAgent.SetDestination(position); } } }