Enemy AI which is driven by a user defined behaviour graph.
More...
|
override string | Header [get] |
|
virtual int | Counter [get, set] |
|
virtual string | ExtraSaveData [get, set] |
| If we are going to save the enemy, this data will be saved if save state is enabled. More...
|
|
virtual string | Header [get] |
| Gets the header string used to describe the component. More...
|
|
virtual string | DocLink [get] |
| Gets a link to documentation site. More...
|
|
virtual string | VideoLink [get] |
| Gets a link to a youtube video. More...
|
|
virtual string | Deprecated [get] |
| If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
|
|
Enemy AI which is driven by a user defined behaviour graph.
◆ CheckForCharacter()
virtual bool PlatformerPro.EnemyAI_AIGraph.CheckForCharacter |
( |
| ) |
|
|
protectedvirtual |
Try to find a character by looking and listening.
- Returns
true
, if for character was checked, false
otherwise.
◆ CheckForExit()
Checks a specific exit condition to see if its conditions have been met and returns true if they have.
◆ Decide()
override EnemyState PlatformerPro.EnemyAI_AIGraph.Decide |
( |
| ) |
|
|
virtual |
◆ DoDamage()
◆ DoUpdate()
virtual void PlatformerPro.EnemyAI_AIGraph.DoUpdate |
( |
| ) |
|
|
protectedvirtual |
Run each frame to determine and execute move.
◆ HandleActions() [1/2]
Do the actions associated with node exit.
- Parameters
-
◆ HandleActions() [2/2]
virtual void PlatformerPro.EnemyAI_AIGraph.HandleActions |
( |
List< NodePort > |
connections | ) |
|
|
protectedvirtual |
Do the actions associated with node exit.
- Parameters
-
◆ HandleEnemyDamaged()
virtual void PlatformerPro.EnemyAI_AIGraph.HandleEnemyDamaged |
( |
object |
sender, |
|
|
DamageInfoEventArgs |
e |
|
) |
| |
|
protectedvirtual |
Handle the enemy getting damaged.
◆ HandleExit()
Handle moving through node exit to a new state. Includes calling any actions on the node.
- Parameters
-
node | Current node |
option | Option position |
- Returns
- true if the state changed, false otherwise
◆ HandleMoveCompleted()
virtual void PlatformerPro.EnemyAI_AIGraph.HandleMoveCompleted |
( |
object |
sender, |
|
|
EventArgs |
e |
|
) |
| |
|
protectedvirtual |
Handle the enemy movement completing.
◆ Hear()
virtual bool PlatformerPro.EnemyAI_AIGraph.Hear |
( |
| ) |
|
|
protectedvirtual |
◆ Init()
override void PlatformerPro.EnemyAI_AIGraph.Init |
( |
Enemy |
enemy | ) |
|
|
virtual |
◆ Message()
override void PlatformerPro.EnemyAI_AIGraph.Message |
( |
string |
message | ) |
|
|
virtual |
◆ ProcessCurrentNode()
virtual void PlatformerPro.EnemyAI_AIGraph.ProcessCurrentNode |
( |
| ) |
|
|
protectedvirtual |
Check each state in the graph to determine if it should exit and if so update the current movement.
◆ ResetHitCounter()
void PlatformerPro.EnemyAI_AIGraph.ResetHitCounter |
( |
| ) |
|
Reset the number of hits counter to 0.
◆ ResetPhase()
virtual void PlatformerPro.EnemyAI_AIGraph.ResetPhase |
( |
| ) |
|
|
protectedvirtual |
◆ ResetState()
virtual void PlatformerPro.EnemyAI_AIGraph.ResetState |
( |
| ) |
|
|
protectedvirtual |
◆ See()
virtual bool PlatformerPro.EnemyAI_AIGraph.See |
( |
| ) |
|
|
protectedvirtual |
◆ Sense()
override bool PlatformerPro.EnemyAI_AIGraph.Sense |
( |
| ) |
|
|
virtual |
◆ StateNotTransitioned()
override void PlatformerPro.EnemyAI_AIGraph.StateNotTransitioned |
( |
| ) |
|
|
virtual |
Called to tell the AI that we were not able to handle the desired state. Usually due to a movement that wont release control.
Reimplemented from PlatformerPro.EnemyAI.
◆ StateTransitioned()
override void PlatformerPro.EnemyAI_AIGraph.StateTransitioned |
( |
| ) |
|
|
virtual |
◆ SwitchPhase()
virtual void PlatformerPro.EnemyAI_AIGraph.SwitchPhase |
( |
EnemyAIGraph |
graph | ) |
|
|
protectedvirtual |
Find the entry point of the graph and set up the first action.
◆ UpdateTimers()
virtual void PlatformerPro.EnemyAI_AIGraph.UpdateTimers |
( |
| ) |
|
|
protectedvirtual |
Check the timer interrupts to see if any should fire.
◆ alwaysFaceTarget
bool PlatformerPro.EnemyAI_AIGraph.alwaysFaceTarget |
If true we always face the target if we have one.
◆ checkForCharacterResult
bool PlatformerPro.EnemyAI_AIGraph.checkForCharacterResult |
|
protected |
Result of the last check for character.
◆ counter
int PlatformerPro.EnemyAI_AIGraph.counter |
|
protected |
A generic counter you can use to control loops etc.
◆ counterInterrupts
Cached reference to the counter handlers.
◆ currentGraph
◆ currentNode
EnemyNode PlatformerPro.EnemyAI_AIGraph.currentNode |
|
protected |
Where are we in the enemy graph?
◆ damageInterrupt
Cached reference to the damage handler.
◆ faceTargetLeeway
float PlatformerPro.EnemyAI_AIGraph.faceTargetLeeway = 0.25f |
Leeway required before we change facing direction when facing target.
◆ graphLookup
Dictionary<string, EnemyAIGraph> PlatformerPro.EnemyAI_AIGraph.graphLookup |
|
protected |
Associated graph name to graph.
◆ graphs
The graphs to use to control the enemies behaviour. The first entry is the starting phase.
◆ graphTimer
float PlatformerPro.EnemyAI_AIGraph.graphTimer |
|
protected |
Stores how long we have been in current state. If the same state is played multiple times this tracks the time in the CURRENT iteration.
◆ hasDecided
bool PlatformerPro.EnemyAI_AIGraph.hasDecided |
|
protected |
Track if we have run our decision logic already. If so we wont run it again. Instead just return the current state.
◆ hasHadInterruptThisFrame
bool PlatformerPro.EnemyAI_AIGraph.hasHadInterruptThisFrame |
|
protected |
Track if an interrupt has already made us transition this frame. If so we can't transition again.
◆ hasRunCheckForCharacter
bool PlatformerPro.EnemyAI_AIGraph.hasRunCheckForCharacter |
|
protected |
Track if we have run the check for player call so we don't eat resources by running it more than once a frame.
◆ hasTransitionedThisFrame
bool PlatformerPro.EnemyAI_AIGraph.hasTransitionedThisFrame |
|
protected |
Track if anything has already made us transition this frame. If so we can't transition again.
◆ healthInterrupts
Cached reference to the health interrupt handlers.
◆ hearingLayers
LayerMask PlatformerPro.EnemyAI_AIGraph.hearingLayers |
Layers to check for proximity sense.
◆ hearingOffset
Vector2 PlatformerPro.EnemyAI_AIGraph.hearingOffset |
Centre point of the proximity sense.
◆ hearingRadius
float PlatformerPro.EnemyAI_AIGraph.hearingRadius = 1.0f |
Range of the proximity sense.
◆ hitCount
int PlatformerPro.EnemyAI_AIGraph.hitCount |
|
protected |
Stores the number of times we have been damaged while in current state.
◆ locked
bool PlatformerPro.EnemyAI_AIGraph.locked |
|
protected |
If the AI is locked we can't change state. Generally used to wait for a movement to complete.
◆ maxTargetDistance
float PlatformerPro.EnemyAI_AIGraph.maxTargetDistance |
Distance at which the target is "lost".
◆ messageInterrupts
Cached reference to the message interrupt handlers.
◆ myTransform
Transform PlatformerPro.EnemyAI_AIGraph.myTransform |
|
protected |
Cached transform reference.
◆ proximityColliders
Collider2D [] PlatformerPro.EnemyAI_AIGraph.proximityColliders |
|
protected |
Used to store results of hearing overlap call.
◆ sightDistance
float PlatformerPro.EnemyAI_AIGraph.sightDistance = 5.0f |
How far can the enemy see?
◆ sightLayers
LayerMask PlatformerPro.EnemyAI_AIGraph.sightLayers |
Layers to check for obstacle and characters.
◆ sightYOffset
float PlatformerPro.EnemyAI_AIGraph.sightYOffset |
Y position of the characters 'eyes'.
◆ stateMovementComplete
bool PlatformerPro.EnemyAI_AIGraph.stateMovementComplete |
|
protected |
Stores the completion state of current move.
◆ stateTimer
float PlatformerPro.EnemyAI_AIGraph.stateTimer |
|
protected |
Stores how long we have been in current state. If the same state is played multiple times this tracks the time in the CURRENT iteration.
◆ timerInterrupts
Cached reference to the timer handlers.
◆ timers
float [] PlatformerPro.EnemyAI_AIGraph.timers |
|
protected |
Timers for each timer handler.
◆ Counter
virtual int PlatformerPro.EnemyAI_AIGraph.Counter |
|
getset |
◆ Header
override string PlatformerPro.EnemyAI_AIGraph.Header |
|
get |
The documentation for this class was generated from the following file:
- D:/Projects/platformer-pro-2019.3/Assets/PlatformerPro/Scripts/Enemies/AI/EnemyAI_AIGraph.cs