/// ---------------------------------------------
/// Ultimate Character Controller
/// Copyright (c) Opsive. All Rights Reserved.
/// https://www.opsive.com
/// ---------------------------------------------
namespace Opsive.UltimateCharacterController.Demo.AI
{
using Opsive.UltimateCharacterController.Character.Abilities.AI;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
using Opsive.UltimateCharacterController.Utility;
using UnityEngine;
///
/// Moves the agent to random positions within a circle. No pathfinding is done.
///
public class AgentMovement : PathfindingMovement
{
[Tooltip("The radius of the position that the character can traverse to.")]
[SerializeField] protected float m_Radius = 3;
[Tooltip("The agent has arrived at the destination when the distance is less than the stopping distance.")]
[SerializeField] protected float m_StoppingDistance = 0.1f;
[Tooltip("The amount of time that the agent should wait at each destination.")]
[SerializeField] protected MinMaxFloat m_RandomWait = new MinMaxFloat(0.2f, 0.7f);
private Use m_UseAbility;
private Vector3 m_Center;
private Vector3 m_Destination;
private Vector2 m_InputVector;
private float m_WaitTime;
private float m_ArriveTime;
public override Vector2 InputVector { get { return m_InputVector; } }
public override Vector3 DeltaRotation { get { return Vector3.zero; } }
///
/// Initialize the default values.
///
public override void Awake()
{
base.Awake();
m_UseAbility = m_CharacterLocomotion.GetAbility