Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.EnemyAI_PatrolToAttack Class Reference

Anemy AI which moves the character from whatever default is set to an attack state if the enemy comes within range. More...

Inheritance diagram for PlatformerPro.EnemyAI_PatrolToAttack:
PlatformerPro.EnemyAI PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

override void Init (Enemy enemy)
 Init this enemy AI. More...
 
override EnemyState Decide ()
 Decide the next move More...
 
- Public Member Functions inherited from PlatformerPro.EnemyAI
virtual bool UpdateTimer ()
 Update the timer by frame time, we drive this externally so we can halt the mob from a single place (the Enemy script). More...
 
virtual DamageInfo DoDamage (DamageInfo info)
 Handle damage. More...
 
virtual bool Sense ()
 The sense routine used to detect when something changes. Sense is called every frame and should be kept as simple as possible. Use Decide() for more complex logic. More...
 
virtual void StateTransitioned ()
 Called to tell the AI that we were able to handle the desired state. More...
 
virtual void StateNotTransitioned ()
 Called to tell the AI that we were not able to handle the desired state. Usually due to a movement that wont release control. More...
 
virtual void Message (string message)
 Handle a message sent to the enemy. More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Public Attributes

float enemyDistance
 Distance to check for enemy. More...
 
LayerMask characterLayer
 Layer to check for characters on. More...
 
- Public Attributes inherited from PlatformerPro.EnemyAI
float decisionInterval
 How long between decisions, increasing this improves performance but makes the enemy less responsive. More...
 

Protected Attributes

Transform myTransform
 Cached transform reference. More...
 
- Protected Attributes inherited from PlatformerPro.EnemyAI
float decisionTimer
 Timer for tracking decision interval. More...
 
Enemy enemy
 Enemy reference. More...
 

Additional Inherited Members

- Properties inherited from PlatformerPro.EnemyAI
virtual string ExtraSaveData [get, set]
 If we are going to save the enemy, this data will be saved if save state is enabled. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
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...
 

Detailed Description

Anemy AI which moves the character from whatever default is set to an attack state if the enemy comes within range.

Member Function Documentation

◆ Decide()

override EnemyState PlatformerPro.EnemyAI_PatrolToAttack.Decide ( )
virtual

Decide the next move

Reimplemented from PlatformerPro.EnemyAI.

◆ Init()

override void PlatformerPro.EnemyAI_PatrolToAttack.Init ( Enemy  enemy)
virtual

Init this enemy AI.

Parameters
enemyEnemy we are the brain for.

Reimplemented from PlatformerPro.EnemyAI.

Member Data Documentation

◆ characterLayer

LayerMask PlatformerPro.EnemyAI_PatrolToAttack.characterLayer

Layer to check for characters on.

◆ enemyDistance

float PlatformerPro.EnemyAI_PatrolToAttack.enemyDistance

Distance to check for enemy.

◆ myTransform

Transform PlatformerPro.EnemyAI_PatrolToAttack.myTransform
protected

Cached transform reference.


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