Add this component to a CorgiController2D and it will walk, turn back when it hits a wall, and try and avoid holes if you ask it to.
More...
|
| enum | WalkBehaviours { Patrol
, MoveOnSight
} |
| | The agent's possible walk behaviours : patrol will have it walk in random directions until a wall or hole is hit, MoveOnSight will make the agent move only when "seeing" a target. More...
|
|
| WalkBehaviours | WalkBehaviour = WalkBehaviours.Patrol |
| | The agent's walk behaviour.
|
| bool | ChangeDirectionOnWall = true |
| | If set to true, the agent will change direction when hitting a wall.
|
| bool | AvoidFalling = false |
| | If set to true, the agent will try and avoid falling.
|
| Vector3 | HoleDetectionOffset = new Vector3(0, 0, 0) |
| | The offset the hole detection should take into account.
|
| float | HoleDetectionRaycastLength =1f |
| | the length of the ray cast to detect holes
|
| float | ViewDistance = 10f |
| | The maximum distance at which the AI can see the target.
|
| float | StopDistance = 1f |
| | the horizontal distance from its target at which the agent will stop moving. Between that distance and the walk distance, the agent will slow down progressively
|
| Vector3 | MoveOnSightRayOffset = new Vector3(0,0,0) |
| | The offset to apply to the raycast origin point (by default the position of the object)
|
| LayerMask | MoveOnSightLayer = LayerManager.PlayerLayerMask |
| | the layer mask to use to detect targets
|
| LayerMask | MoveOnSightObstaclesLayer = LayerManager.ObstaclesLayerMask |
| | the layer mask of the sight obstacles (usually platforms)
|
| Vector3 | ObstacleDetectionRayOffset = new Vector3(0,0,0) |
| | The offset to apply to the raycast origin point (by default the position of the object)
|
| bool | ResetPositionOnDeath = true |
| | if this is true, the character will automatically return to its initial position on revive
|
|
| virtual void | Start () |
| | Initialization.
|
| virtual void | Initialization () |
| virtual void | Update () |
| | Every frame, moves the agent and checks if it can shoot at the player.
|
| virtual void | CheckForWalls () |
| | Checks for a wall and changes direction if it meets one.
|
| virtual void | CheckForHoles () |
| | Checks for holes.
|
| virtual void | CheckForTarget () |
| | Casts a ray (if needed) to see if a target is in sight. If yes, moves towards it.
|
| virtual void | ChangeDirection () |
| | Changes the agent's direction and flips its transform.
|
| virtual void | OnRevive () |
| virtual void | OnEnable () |
| | When the player respawns, we reinstate this agent.
|
| virtual void | OnDisable () |
Add this component to a CorgiController2D and it will walk, turn back when it hits a wall, and try and avoid holes if you ask it to.
◆ WalkBehaviours
The agent's possible walk behaviours : patrol will have it walk in random directions until a wall or hole is hit, MoveOnSight will make the agent move only when "seeing" a target.
| Enumerator |
|---|
| Patrol | |
| MoveOnSight | |
◆ ChangeDirection()
| virtual void MoreMountains.CorgiEngine.AIWalk.ChangeDirection |
( |
| ) |
|
|
protectedvirtual |
Changes the agent's direction and flips its transform.
◆ CheckForHoles()
| virtual void MoreMountains.CorgiEngine.AIWalk.CheckForHoles |
( |
| ) |
|
|
protectedvirtual |
◆ CheckForTarget()
| virtual void MoreMountains.CorgiEngine.AIWalk.CheckForTarget |
( |
| ) |
|
|
protectedvirtual |
Casts a ray (if needed) to see if a target is in sight. If yes, moves towards it.
◆ CheckForWalls()
| virtual void MoreMountains.CorgiEngine.AIWalk.CheckForWalls |
( |
| ) |
|
|
protectedvirtual |
Checks for a wall and changes direction if it meets one.
◆ Initialization()
| virtual void MoreMountains.CorgiEngine.AIWalk.Initialization |
( |
| ) |
|
|
protectedvirtual |
◆ OnDisable()
| virtual void MoreMountains.CorgiEngine.AIWalk.OnDisable |
( |
| ) |
|
|
protectedvirtual |
◆ OnEnable()
| virtual void MoreMountains.CorgiEngine.AIWalk.OnEnable |
( |
| ) |
|
|
protectedvirtual |
When the player respawns, we reinstate this agent.
- Parameters
-
| checkpoint | Checkpoint. |
| player | Player. |
◆ OnRevive()
| virtual void MoreMountains.CorgiEngine.AIWalk.OnRevive |
( |
| ) |
|
|
protectedvirtual |
◆ Start()
| virtual void MoreMountains.CorgiEngine.AIWalk.Start |
( |
| ) |
|
|
protectedvirtual |
◆ Update()
| virtual void MoreMountains.CorgiEngine.AIWalk.Update |
( |
| ) |
|
|
protectedvirtual |
Every frame, moves the agent and checks if it can shoot at the player.
◆ _character
| Character MoreMountains.CorgiEngine.AIWalk._character |
|
protected |
◆ _characterHorizontalMovement
◆ _controller
◆ _direction
| Vector2 MoreMountains.CorgiEngine.AIWalk._direction |
|
protected |
◆ _distanceToTarget
| float MoreMountains.CorgiEngine.AIWalk._distanceToTarget |
|
protected |
◆ _health
| Health MoreMountains.CorgiEngine.AIWalk._health |
|
protected |
◆ _initialDirection
| Vector2 MoreMountains.CorgiEngine.AIWalk._initialDirection |
|
protected |
◆ _initialScale
| Vector3 MoreMountains.CorgiEngine.AIWalk._initialScale |
|
protected |
◆ _offset
| Vector2 MoreMountains.CorgiEngine.AIWalk._offset |
|
protected |
◆ _raycastOrigin
| Vector2 MoreMountains.CorgiEngine.AIWalk._raycastOrigin |
|
protected |
◆ _startPosition
| Vector2 MoreMountains.CorgiEngine.AIWalk._startPosition |
|
protected |
◆ AvoidFalling
| bool MoreMountains.CorgiEngine.AIWalk.AvoidFalling = false |
If set to true, the agent will try and avoid falling.
◆ ChangeDirectionOnWall
| bool MoreMountains.CorgiEngine.AIWalk.ChangeDirectionOnWall = true |
If set to true, the agent will change direction when hitting a wall.
◆ HoleDetectionOffset
| Vector3 MoreMountains.CorgiEngine.AIWalk.HoleDetectionOffset = new Vector3(0, 0, 0) |
The offset the hole detection should take into account.
◆ HoleDetectionRaycastLength
| float MoreMountains.CorgiEngine.AIWalk.HoleDetectionRaycastLength =1f |
the length of the ray cast to detect holes
◆ MoveOnSightLayer
the layer mask to use to detect targets
◆ MoveOnSightObstaclesLayer
the layer mask of the sight obstacles (usually platforms)
◆ MoveOnSightRayOffset
| Vector3 MoreMountains.CorgiEngine.AIWalk.MoveOnSightRayOffset = new Vector3(0,0,0) |
The offset to apply to the raycast origin point (by default the position of the object)
◆ ObstacleDetectionRayOffset
| Vector3 MoreMountains.CorgiEngine.AIWalk.ObstacleDetectionRayOffset = new Vector3(0,0,0) |
The offset to apply to the raycast origin point (by default the position of the object)
◆ ResetPositionOnDeath
| bool MoreMountains.CorgiEngine.AIWalk.ResetPositionOnDeath = true |
if this is true, the character will automatically return to its initial position on revive
◆ StopDistance
| float MoreMountains.CorgiEngine.AIWalk.StopDistance = 1f |
the horizontal distance from its target at which the agent will stop moving. Between that distance and the walk distance, the agent will slow down progressively
◆ ViewDistance
| float MoreMountains.CorgiEngine.AIWalk.ViewDistance = 10f |
The maximum distance at which the AI can see the target.
◆ WalkBehaviour
The agent's walk behaviour.
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/Scripts/Agents/AI/Legacy/AIWalk.cs