TopDown Engine  v3.6
MoreMountains.TopDownEngine.AIActionMovePatrol3D Class Reference

This Action will make the Character patrol along the defined path (see the MMPath inspector for that) until it hits a wall or a hole while following a path. More...

Inheritance diagram for MoreMountains.TopDownEngine.AIActionMovePatrol3D:
MoreMountains.Tools.AIAction

Public Member Functions

void ResetPatrol (Vector3 targetPos)
 
override void PerformAction ()
 On PerformAction we patrol More...
 
override void OnExitState ()
 When exiting the state we reset our movement More...
 
virtual void ChangeDirection ()
 Changes the current movement direction More...
 
- Public Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Initialization ()
 Initializes the action. Meant to be overridden More...
 
virtual void OnEnterState ()
 Describes what happens when the brain enters the state this action is in. Meant to be overridden. More...
 

Public Attributes

bool ChangeDirectionOnObstacle = true
 If set to true, the agent will change direction when hitting an obstacle. More...
 
float ObstacleDetectionDistance = 1f
 the distance to look for obstacles at More...
 
float ObstaclesCheckFrequency = 1f
 the frequency (in seconds) at which to check for obstacles More...
 
LayerMask ObstacleLayerMask = LayerManager.ObstaclesLayerMask
 the layer(s) to look for obstacles on More...
 
int CurrentPathIndex = 0
 the index of the current MMPath element this agent is patrolling towards More...
 
- Public Attributes inherited from MoreMountains.Tools.AIAction
InitializationModes InitializationMode
 
string Label
 a label you can set to organize your AI Actions, not used by anything else More...
 

Protected Member Functions

override void Awake ()
 On init we grab all the components we'll need More...
 
virtual void InitializePatrol ()
 
virtual void Patrol ()
 This method initiates all the required checks and moves the character More...
 
virtual void DetermineDelay ()
 
virtual void OnDrawGizmosSelected ()
 Draws bounds gizmos More...
 
virtual void CheckForObstacles ()
 Checks for a wall and changes direction if it meets one More...
 
virtual void OnRevive ()
 When reviving we make sure our directions are properly setup More...
 
virtual void OnEnable ()
 On enable we start listening for OnRevive events More...
 
virtual void OnDisable ()
 On disable we stop listening for OnRevive events More...
 

Protected Attributes

TopDownController _controller
 
Character _character
 
CharacterMovement _characterMovement
 
Health _health
 
Vector3 _direction
 
Vector3 _startPosition
 
Vector3 _initialDirection
 
Vector3 _initialScale
 
float _distanceToTarget
 
Vector3 _initialPosition
 
MMPath _mmPath
 
Collider _collider
 
float _lastObstacleDetectionTimestamp = 0f
 
int _indexLastFrame = -1
 
float _waitingDelay = 0f
 
float _lastPatrolPointReachedAt = 0f
 
- Protected Attributes inherited from MoreMountains.Tools.AIAction
bool _initialized
 
AIBrain _brain
 

Properties

virtual Vector3 LastReachedPatrolPoint [get, set]
 the coordinates of the last patrol point More...
 
- Properties inherited from MoreMountains.Tools.AIAction
virtual bool ActionInProgress [get, set]
 
virtual bool ShouldInitialize [get]
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { InitializationModes.EveryTime, InitializationModes.OnlyOnce }
 

Detailed Description

This Action will make the Character patrol along the defined path (see the MMPath inspector for that) until it hits a wall or a hole while following a path.

Member Function Documentation

◆ Awake()

override void MoreMountains.TopDownEngine.AIActionMovePatrol3D.Awake ( )
protectedvirtual

On init we grab all the components we'll need

Reimplemented from MoreMountains.Tools.AIAction.

◆ ChangeDirection()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.ChangeDirection ( )
virtual

Changes the current movement direction

◆ CheckForObstacles()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.CheckForObstacles ( )
protectedvirtual

Checks for a wall and changes direction if it meets one

◆ DetermineDelay()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.DetermineDelay ( )
protectedvirtual

◆ InitializePatrol()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.InitializePatrol ( )
protectedvirtual

◆ OnDisable()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.OnDisable ( )
protectedvirtual

On disable we stop listening for OnRevive events

◆ OnDrawGizmosSelected()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.OnDrawGizmosSelected ( )
protectedvirtual

Draws bounds gizmos

◆ OnEnable()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.OnEnable ( )
protectedvirtual

On enable we start listening for OnRevive events

◆ OnExitState()

override void MoreMountains.TopDownEngine.AIActionMovePatrol3D.OnExitState ( )
virtual

When exiting the state we reset our movement

Reimplemented from MoreMountains.Tools.AIAction.

◆ OnRevive()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.OnRevive ( )
protectedvirtual

When reviving we make sure our directions are properly setup

◆ Patrol()

virtual void MoreMountains.TopDownEngine.AIActionMovePatrol3D.Patrol ( )
protectedvirtual

This method initiates all the required checks and moves the character

◆ PerformAction()

override void MoreMountains.TopDownEngine.AIActionMovePatrol3D.PerformAction ( )
virtual

On PerformAction we patrol

Implements MoreMountains.Tools.AIAction.

◆ ResetPatrol()

void MoreMountains.TopDownEngine.AIActionMovePatrol3D.ResetPatrol ( Vector3  targetPos)

Member Data Documentation

◆ _character

Character MoreMountains.TopDownEngine.AIActionMovePatrol3D._character
protected

◆ _characterMovement

CharacterMovement MoreMountains.TopDownEngine.AIActionMovePatrol3D._characterMovement
protected

◆ _collider

Collider MoreMountains.TopDownEngine.AIActionMovePatrol3D._collider
protected

◆ _controller

TopDownController MoreMountains.TopDownEngine.AIActionMovePatrol3D._controller
protected

◆ _direction

Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D._direction
protected

◆ _distanceToTarget

float MoreMountains.TopDownEngine.AIActionMovePatrol3D._distanceToTarget
protected

◆ _health

Health MoreMountains.TopDownEngine.AIActionMovePatrol3D._health
protected

◆ _indexLastFrame

int MoreMountains.TopDownEngine.AIActionMovePatrol3D._indexLastFrame = -1
protected

◆ _initialDirection

Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D._initialDirection
protected

◆ _initialPosition

Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D._initialPosition
protected

◆ _initialScale

Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D._initialScale
protected

◆ _lastObstacleDetectionTimestamp

float MoreMountains.TopDownEngine.AIActionMovePatrol3D._lastObstacleDetectionTimestamp = 0f
protected

◆ _lastPatrolPointReachedAt

float MoreMountains.TopDownEngine.AIActionMovePatrol3D._lastPatrolPointReachedAt = 0f
protected

◆ _mmPath

MMPath MoreMountains.TopDownEngine.AIActionMovePatrol3D._mmPath
protected

◆ _startPosition

Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D._startPosition
protected

◆ _waitingDelay

float MoreMountains.TopDownEngine.AIActionMovePatrol3D._waitingDelay = 0f
protected

◆ ChangeDirectionOnObstacle

bool MoreMountains.TopDownEngine.AIActionMovePatrol3D.ChangeDirectionOnObstacle = true

If set to true, the agent will change direction when hitting an obstacle.

◆ CurrentPathIndex

int MoreMountains.TopDownEngine.AIActionMovePatrol3D.CurrentPathIndex = 0

the index of the current MMPath element this agent is patrolling towards

◆ ObstacleDetectionDistance

float MoreMountains.TopDownEngine.AIActionMovePatrol3D.ObstacleDetectionDistance = 1f

the distance to look for obstacles at

◆ ObstacleLayerMask

LayerMask MoreMountains.TopDownEngine.AIActionMovePatrol3D.ObstacleLayerMask = LayerManager.ObstaclesLayerMask

the layer(s) to look for obstacles on

◆ ObstaclesCheckFrequency

float MoreMountains.TopDownEngine.AIActionMovePatrol3D.ObstaclesCheckFrequency = 1f

the frequency (in seconds) at which to check for obstacles

Property Documentation

◆ LastReachedPatrolPoint

virtual Vector3 MoreMountains.TopDownEngine.AIActionMovePatrol3D.LastReachedPatrolPoint
getset

the coordinates of the last patrol point


The documentation for this class was generated from the following file: