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

Requires a CharacterMovement ability. Makes the character move up to the specified MinimumDistance in the direction of the target. More...

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

Public Member Functions

override void Initialization ()
 On init we grab our CharacterMovement ability More...
 
override void PerformAction ()
 On PerformAction we move More...
 
override void OnExitState ()
 On exit state we stop our movement More...
 
- Public Member Functions inherited from MoreMountains.Tools.AIAction
virtual void OnEnterState ()
 Describes what happens when the brain enters the state this action is in. Meant to be overridden. More...
 

Public Attributes

bool UseMinimumXDistance = true
 if this is true, movement will be constrained to not overstep a certain distance to the target on the x axis More...
 
float MinimumXDistance = 1f
 the minimum distance from the target this Character can reach on the x axis. 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

virtual void Move ()
 Moves the character towards the target if needed More...
 
- Protected Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain More...
 

Protected Attributes

Vector2 _direction
 
CharacterMovement _characterMovement
 
int _numberOfJumps = 0
 
- Protected Attributes inherited from MoreMountains.Tools.AIAction
bool _initialized
 
AIBrain _brain
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { InitializationModes.EveryTime, InitializationModes.OnlyOnce }
 
- Properties inherited from MoreMountains.Tools.AIAction
virtual bool ActionInProgress [get, set]
 
virtual bool ShouldInitialize [get]
 

Detailed Description

Requires a CharacterMovement ability. Makes the character move up to the specified MinimumDistance in the direction of the target.

Member Function Documentation

◆ Initialization()

override void MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D.Initialization ( )
virtual

On init we grab our CharacterMovement ability

Reimplemented from MoreMountains.Tools.AIAction.

◆ Move()

virtual void MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D.Move ( )
protectedvirtual

Moves the character towards the target if needed

◆ OnExitState()

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

On exit state we stop our movement

Reimplemented from MoreMountains.Tools.AIAction.

◆ PerformAction()

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

On PerformAction we move

Implements MoreMountains.Tools.AIAction.

Member Data Documentation

◆ _characterMovement

CharacterMovement MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D._characterMovement
protected

◆ _direction

Vector2 MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D._direction
protected

◆ _numberOfJumps

int MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D._numberOfJumps = 0
protected

◆ MinimumXDistance

float MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D.MinimumXDistance = 1f

the minimum distance from the target this Character can reach on the x axis.

◆ UseMinimumXDistance

bool MoreMountains.TopDownEngine.AIActionMoveTowardsTarget2D.UseMinimumXDistance = true

if this is true, movement will be constrained to not overstep a certain distance to the target on the x axis


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