Corgi Engine v9.3
MoreMountains.CorgiEngine.AIActionPatrolAndJump Class Reference

This Action will make the Character patrol while jumping until it (optionally) hits a wall or a hole. More...

Inheritance diagram for MoreMountains.CorgiEngine.AIActionPatrolAndJump:
MoreMountains.CorgiEngine.AIActionPatrol MoreMountains.Tools.AIAction

Public Member Functions

override void Initialization ()
 On init we grab all the components we'll need More...
 
- Public Member Functions inherited from MoreMountains.CorgiEngine.AIActionPatrol
override void PerformAction ()
 On PerformAction we patrol More...
 
override void OnExitState ()
 When exiting the state we reset 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...
 

Protected Member Functions

override void Patrol ()
 This method initiates all the required checks and moves the character More...
 
- Protected Member Functions inherited from MoreMountains.CorgiEngine.AIActionPatrol
virtual void CheckForWalls ()
 Checks for a wall and changes direction if it meets one More...
 
bool DetectObstaclesRegularLayermask ()
 Returns true if an obstacle is colliding with this AI, using its controller layer masks More...
 
bool DetectObstaclesCustomLayermask ()
 Returns true if an obstacle is in front of the character, using a custom layer mask More...
 
virtual void CheckForHoles ()
 Checks for holes More...
 
virtual void ChangeDirection ()
 Changes the current movement direction 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 Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain More...
 

Protected Attributes

CharacterJump _characterJump
 
- Protected Attributes inherited from MoreMountains.CorgiEngine.AIActionPatrol
CorgiController _controller
 
Character _character
 
Health _health
 
CharacterHorizontalMovement _characterHorizontalMovement
 
Vector2 _direction
 
Vector2 _startPosition
 
Vector2 _initialDirection
 
Vector3 _initialScale
 
float _distanceToTarget
 
Vector2 _raycastOrigin
 
RaycastHit2D _raycastHit2D
 
Vector2 _obstacleDirection
 
- Protected Attributes inherited from MoreMountains.Tools.AIAction
bool _initialized
 
AIBrain _brain
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { EveryTime , OnlyOnce }
 
- Public Attributes inherited from MoreMountains.CorgiEngine.AIActionPatrol
bool ChangeDirectionOnWall = true
 If set to true, the agent will change direction when hitting a wall. More...
 
bool AvoidFalling = false
 If set to true, the agent will try and avoid falling. More...
 
Vector3 HoleDetectionOffset = new Vector3(0, 0, 0)
 The offset the hole detection should take into account. More...
 
float HoleDetectionRaycastLength = 1f
 the length of the ray cast to detect holes More...
 
bool UseCustomLayermask = false
 Whether to use a custom layermask, or simply use the platform mask defined at the character level. More...
 
LayerMask ObstaclesLayermask = LayerManager.ObstaclesLayerMask
 if using a custom layer mask, the list of layers considered as obstacles by this AI More...
 
float ObstaclesDetectionRaycastLength = 0.5f
 the length of the horizontal raycast we should use to detect obstacles that may cause a direction change More...
 
Vector2 ObstaclesDetectionRaycastOrigin = new Vector2(0.5f, 0f)
 the origin of the raycast (if casting against the same layer this object is on, the origin should be outside its collider, typically in front of it) More...
 
bool ResetPositionOnDeath = true
 if this is true, the character will automatically return to its initial position on revive More...
 
- Public Attributes inherited from MoreMountains.Tools.AIAction
InitializationModes InitializationMode
 whether initialization should happen only once, or every time the brain is reset More...
 
string Label
 a label you can set to organize your AI Actions, not used by anything else More...
 
- Properties inherited from MoreMountains.Tools.AIAction
virtual bool ActionInProgress [getset]
 
virtual bool ShouldInitialize [get]
 

Detailed Description

This Action will make the Character patrol while jumping until it (optionally) hits a wall or a hole.

Member Function Documentation

◆ Initialization()

override void MoreMountains.CorgiEngine.AIActionPatrolAndJump.Initialization ( )
virtual

On init we grab all the components we'll need

Reimplemented from MoreMountains.CorgiEngine.AIActionPatrol.

◆ Patrol()

override void MoreMountains.CorgiEngine.AIActionPatrolAndJump.Patrol ( )
protectedvirtual

This method initiates all the required checks and moves the character

Reimplemented from MoreMountains.CorgiEngine.AIActionPatrol.

Member Data Documentation

◆ _characterJump

CharacterJump MoreMountains.CorgiEngine.AIActionPatrolAndJump._characterJump
protected

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