![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
An enemy movement that quickly snaps upwards at player if they come within range. More...
Public Member Functions | |
override EnemyMovement | Init (Enemy enemy) |
Initialise this movement and return a reference to the ready to use movement. More... | |
override bool | DoMove () |
Moves the character. More... | |
override void | HitCharacter (Character character, DamageInfo info) |
Called when the enemy hits the character. More... | |
override void | SwitchDirection () |
Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing. More... | |
![]() | |
virtual void | DoDamage (DamageInfo info) |
Do the damage movement More... | |
virtual void | DoDeath (DamageInfo info) |
Do the death movement More... | |
virtual void | GainingControl () |
Called when this movement is gaining control. More... | |
virtual bool | LosingControl () |
Called when this movement is losing control. More... | |
virtual void | SetDirection (Vector2 direction) |
Often a movement will need some kind of direction information such as where the cahracter is in relation to the enemy. Use this to set that information. Note there is no specific rule for what that information is, it could be anything. More... | |
virtual bool | CheckForEdge (int movementDirection) |
Uses the Enemies feet colliders to see if there is nothing below the enemy, and if so returns true. More... | |
![]() | |
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 | speed = 5.0f |
The speed the enemy snaps upwards at. More... | |
float | retractSpeed = 2.0f |
The speed the enemy retracts back at. More... | |
float | moveRange = 2.0f |
How far the enemy can charge upwards. More... | |
bool | autoRetractAtTop = false |
If true automatically retract after reaching the top position. If false stay in top position. More... | |
bool | mustFullyRetract = true |
If true automatically retract after reaching the top position. If false stay in top position. More... | |
float | sightRange = 2.0f |
How far the enemy can 'see'. More... | |
LayerMask | sightLayers |
The layers that trigger the snapping charge. More... | |
int | damageAmount = 1 |
The damage amount. More... | |
DamageType | damageType = DamageType.PHYSICAL |
The type of the damage. More... | |
AnimationState | animationState = AnimationState.ATTACK |
The animation state to set while charging. More... | |
AnimationState | animationStateRetract = AnimationState.WALK |
The animation state to set while retracting. More... | |
Protected Member Functions | |
virtual void | CheckForPlayer () |
Checks for the player and updates state. More... | |
Protected Attributes | |
SnapperState | state = SnapperState.IDLE |
The current state. More... | |
Vector2 | startingPos |
The position we start at. More... | |
Vector2 | endingPos |
The position we end at. More... | |
![]() | |
Enemy | enemy |
Cached reference to the character. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
override int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More... | |
![]() | |
virtual AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
virtual string | OverrideState [get] |
Gets the animation override state that this movement wants to set. More... | |
virtual int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More... | |
virtual bool | ShouldSnapToGround [get] |
If we are grounded shoudl we snap to the ground. Helps us handle slopes. More... | |
static MovementInfo | Info [get] |
Static movement info used by the editor. 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... | |
An enemy movement that quickly snaps upwards at player if they come within range.
|
protectedvirtual |
Checks for the player and updates state.
|
virtual |
Moves the character.
Reimplemented from PlatformerPro.EnemyMovement.
|
virtual |
Called when the enemy hits the character.
character | Character. |
info | Damage info. |
Reimplemented from PlatformerPro.EnemyMovement.
|
virtual |
Initialise this movement and return a reference to the ready to use movement.
Reimplemented from PlatformerPro.EnemyMovement.
|
virtual |
Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing.
Reimplemented from PlatformerPro.EnemyMovement.
AnimationState PlatformerPro.EnemyMovement_VerticalSnapper.animationState = AnimationState.ATTACK |
The animation state to set while charging.
AnimationState PlatformerPro.EnemyMovement_VerticalSnapper.animationStateRetract = AnimationState.WALK |
The animation state to set while retracting.
bool PlatformerPro.EnemyMovement_VerticalSnapper.autoRetractAtTop = false |
If true automatically retract after reaching the top position. If false stay in top position.
int PlatformerPro.EnemyMovement_VerticalSnapper.damageAmount = 1 |
The damage amount.
DamageType PlatformerPro.EnemyMovement_VerticalSnapper.damageType = DamageType.PHYSICAL |
The type of the damage.
|
protected |
The position we end at.
float PlatformerPro.EnemyMovement_VerticalSnapper.moveRange = 2.0f |
How far the enemy can charge upwards.
bool PlatformerPro.EnemyMovement_VerticalSnapper.mustFullyRetract = true |
If true automatically retract after reaching the top position. If false stay in top position.
float PlatformerPro.EnemyMovement_VerticalSnapper.retractSpeed = 2.0f |
The speed the enemy retracts back at.
LayerMask PlatformerPro.EnemyMovement_VerticalSnapper.sightLayers |
The layers that trigger the snapping charge.
float PlatformerPro.EnemyMovement_VerticalSnapper.sightRange = 2.0f |
How far the enemy can 'see'.
float PlatformerPro.EnemyMovement_VerticalSnapper.speed = 5.0f |
The speed the enemy snaps upwards at.
|
protected |
The position we start at.
|
protected |
The current state.
|
get |
Gets the animation state that this movement wants to set.
|
get |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left.
|
staticget |
Static movement info used by the editor.