![]() |
Corgi Engine v9.3
|
Inherits from AIActionPatrol but also lets you define left and right bounds that the character can't exceed. More...
Public Types | |
enum | BoundsMethods { BasedOnOriginPosition , BasedOnStateEnterPosition } |
BoundsMethods determine whether the bounds will be defined based on the starting position of the Character, or the position it was at when entering the state More... | |
![]() | |
enum | InitializationModes { EveryTime , OnlyOnce } |
Public Member Functions | |
override void | Initialization () |
On init we store our initial position and define our bounds More... | |
override void | OnEnterState () |
On Enter state we determine our bounds if required More... | |
override void | OnExitState () |
On exit state we stop moving More... | |
![]() | |
override void | PerformAction () |
On PerformAction we patrol More... | |
Public Attributes | |
BoundsMethods | BoundsMethod = BoundsMethods.BasedOnOriginPosition |
the chosen BoundsMethod More... | |
float | BoundsExtentsLeft |
the max distance the character can patrol to the left More... | |
float | BoundsExtentsRight |
the max distance the character can patrol to the right More... | |
![]() | |
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... | |
![]() | |
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... | |
Protected Member Functions | |
override void | Patrol () |
When patrolling we make sure we don't exceed our bounds More... | |
virtual void | CheckForDistance () |
Determines whether or not bounds have been exceeded and turns around if needed More... | |
virtual void | EstablishBounds () |
Determines the position of the bounds More... | |
virtual void | OnDrawGizmosSelected () |
Draws bounds gizmos More... | |
![]() | |
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... | |
![]() | |
virtual void | Awake () |
On Awake we grab our AIBrain More... | |
Protected Attributes | |
Vector3 | _initialPosition |
bool | _init = false |
Vector3 | _boundsLeft |
Vector3 | _boundsRight |
![]() | |
CorgiController | _controller |
Character | _character |
Health | _health |
CharacterHorizontalMovement | _characterHorizontalMovement |
Vector2 | _direction |
Vector2 | _startPosition |
Vector2 | _initialDirection |
Vector3 | _initialScale |
float | _distanceToTarget |
Vector2 | _raycastOrigin |
RaycastHit2D | _raycastHit2D |
Vector2 | _obstacleDirection |
![]() | |
bool | _initialized |
AIBrain | _brain |
Additional Inherited Members | |
![]() | |
virtual bool | ActionInProgress [getset] |
virtual bool | ShouldInitialize [get] |
Inherits from AIActionPatrol but also lets you define left and right bounds that the character can't exceed.
BoundsMethods determine whether the bounds will be defined based on the starting position of the Character, or the position it was at when entering the state
Enumerator | |
---|---|
BasedOnOriginPosition | |
BasedOnStateEnterPosition |
|
protectedvirtual |
Determines whether or not bounds have been exceeded and turns around if needed
|
protectedvirtual |
Determines the position of the bounds
|
virtual |
On init we store our initial position and define our bounds
Reimplemented from MoreMountains.CorgiEngine.AIActionPatrol.
|
protectedvirtual |
Draws bounds gizmos
|
virtual |
On Enter state we determine our bounds if required
Reimplemented from MoreMountains.Tools.AIAction.
|
virtual |
On exit state we stop moving
Reimplemented from MoreMountains.CorgiEngine.AIActionPatrol.
|
protectedvirtual |
When patrolling we make sure we don't exceed our bounds
Reimplemented from MoreMountains.CorgiEngine.AIActionPatrol.
|
protected |
|
protected |
|
protected |
|
protected |
float MoreMountains.CorgiEngine.AIActionPatrolWithinBounds.BoundsExtentsLeft |
the max distance the character can patrol to the left
float MoreMountains.CorgiEngine.AIActionPatrolWithinBounds.BoundsExtentsRight |
the max distance the character can patrol to the right
BoundsMethods MoreMountains.CorgiEngine.AIActionPatrolWithinBounds.BoundsMethod = BoundsMethods.BasedOnOriginPosition |
the chosen BoundsMethod