TopDown Engine v4.5
Loading...
Searching...
No Matches
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.
override void OnExitState ()
 When exiting the state we reset our movement.
virtual void ChangeDirection ()
 Changes the current movement direction.
Public Member Functions inherited from MoreMountains.Tools.AIAction
void PerformAction ()
virtual void Initialization ()
 Initializes the action. Meant to be overridden.
virtual void OnEnterState ()
 Describes what happens when the brain enters the state this action is in. Meant to be overridden.

Public Attributes

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

Protected Member Functions

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

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
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 { EveryTime , 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 ( )

On PerformAction we patrol.

◆ ResetPatrol()

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

◆ StopMovement()

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

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:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/AI/Advanced/AIActionMovePatrol3D.cs