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

This is the basic behaviour from which all movement behaviours are derived. To create your own movement extend this class. More...

Inheritance diagram for PlatformerPro.Movement:
PlatformerPro.BaseMovement< T > PlatformerPro.BasicAttacks PlatformerPro.BasicAttacksWithAutoFire PlatformerPro.BlockAttack PlatformerPro.ComboAttacks PlatformerPro.DashAttack PlatformerPro.MultiProjectileAttacks PlatformerPro.PowerBombAttack

Public Member Functions

virtual Movement Init (Character character)
 Initialise this movement and retyrn a reference to the ready to use movement. More...
 
virtual Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data. More...
 
virtual string PostInitValidation ()
 Called after initialisation to check if this movement is configured correctly. Typically used to stop wrapper movements being the default and ending up in infinite loops. More...
 
virtual void DoMove ()
 Moves the character. More...
 
virtual void PostCollisionDoMove ()
 Does any movement that MUST be done after collissions are calculated. More...
 
virtual bool ForceMaintainControl ()
 If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. More...
 
virtual bool CheckAdditionalConditions ()
 If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. More...
 
virtual void ConditionsActivated ()
 Call activated on each condition. More...
 
virtual void GainControl ()
 Called when the movement gets control. Typically used to do initialisation of velocity and the like. More...
 
virtual void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
virtual bool IsGrounded ()
 Determines whether this character is grounded. Only applied if ShouldDoBaseCollisions returned false this frame. Else the IsGrounded() method from the base collisions will be used. More...
 

Static Public Member Functions

static bool CheckSideCollisions (Character character, int requiredHits, RaycastType types)
 Utility method which checks for side collissions. More...
 

Public Attributes

bool skipEquipmentMultipliers
 If true don't apply equipment multipliers to this movement. More...
 
bool skipUpgradeMultipliers
 If true don't apply upgrade multipliers to this movement. More...
 
bool skipPowerUpMultipliers
 If true don't apply power-up multipliers to this movement. More...
 

Protected Member Functions

void AssignReferences (Character character)
 Initialise this movement and return a reference to the ready to use movement. More...
 

Protected Attributes

Character character
 Cached reference to the character. More...
 
AdditionalCondition[] conditions
 Cached list of all additional conditions. More...
 

Properties

virtual Character Character [get]
 Sets the character for this movement. More...
 
virtual bool Enabled [get, set]
 A custom enable which base movements can use to pass on enable values. More...
 
virtual Movement Implementation [get]
 Gets the underlying implementation (if not overridden return itself). More...
 
virtual bool ShouldApplyGravity [get]
 Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. More...
 
virtual float CurrentGravity [get]
 Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()
More...
 
virtual RaycastType ShouldDoBaseCollisions [get]
 Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. More...
 
virtual bool ShouldDoRotations [get]
 Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. 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 AnimationPriority [get]
 Gets the priority of the animation 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 PreventXVelocityReset [get]
 If true then don't allow base collisions to reset velocity in X. More...
 
static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
virtual VelocityType VelocityType [get]
 How does this movement use Velocity. More...
 

Detailed Description

This is the basic behaviour from which all movement behaviours are derived. To create your own movement extend this class.

Member Function Documentation

◆ AssignReferences()

void PlatformerPro.Movement.AssignReferences ( Character  character)
protected

Initialise this movement and return a reference to the ready to use movement.

◆ CheckAdditionalConditions()

virtual bool PlatformerPro.Movement.CheckAdditionalConditions ( )
virtual

If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't.

Returns
true if control is wanted, false otherwise.

◆ CheckSideCollisions()

static bool PlatformerPro.Movement.CheckSideCollisions ( Character  character,
int  requiredHits,
RaycastType  types 
)
static

Utility method which checks for side collissions.

Returns
true, if sides hit something, false otherwise.
Parameters
characterCharacter to check.
requiredHitsRequired number of side hits.
typesSide types to check.

◆ ConditionsActivated()

virtual void PlatformerPro.Movement.ConditionsActivated ( )
virtual

Call activated on each condition.

◆ DoMove()

virtual void PlatformerPro.Movement.DoMove ( )
virtual

Moves the character.

Reimplemented in PlatformerPro.PowerBombAttack, and PlatformerPro.DashAttack.

◆ ForceMaintainControl()

virtual bool PlatformerPro.Movement.ForceMaintainControl ( )
virtual

If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't.

Returns
true if control is wanted, false otherwise.

Reimplemented in PlatformerPro.BasicAttacks.

◆ GainControl()

virtual void PlatformerPro.Movement.GainControl ( )
virtual

Called when the movement gets control. Typically used to do initialisation of velocity and the like.

◆ Init() [1/2]

virtual Movement PlatformerPro.Movement.Init ( Character  character)
virtual

Initialise this movement and retyrn a reference to the ready to use movement.

Reimplemented in PlatformerPro.BaseMovement< T >, and PlatformerPro.BasicAttacks.

◆ Init() [2/2]

virtual Movement PlatformerPro.Movement.Init ( Character  character,
MovementVariable[]  movementData 
)
virtual

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ IsGrounded()

virtual bool PlatformerPro.Movement.IsGrounded ( )
virtual

Determines whether this character is grounded. Only applied if ShouldDoBaseCollisions returned false this frame. Else the IsGrounded() method from the base collisions will be used.

Returns
true if this character is grounded; otherwise, false.

◆ LosingControl()

virtual void PlatformerPro.Movement.LosingControl ( )
virtual

Called when the movement loses control. Override to do any reset type actions.

◆ PostCollisionDoMove()

virtual void PlatformerPro.Movement.PostCollisionDoMove ( )
virtual

Does any movement that MUST be done after collissions are calculated.

◆ PostInitValidation()

virtual string PlatformerPro.Movement.PostInitValidation ( )
virtual

Called after initialisation to check if this movement is configured correctly. Typically used to stop wrapper movements being the default and ending up in infinite loops.

Member Data Documentation

◆ character

Character PlatformerPro.Movement.character
protected

Cached reference to the character.

◆ conditions

AdditionalCondition [] PlatformerPro.Movement.conditions
protected

Cached list of all additional conditions.

◆ skipEquipmentMultipliers

bool PlatformerPro.Movement.skipEquipmentMultipliers

If true don't apply equipment multipliers to this movement.

◆ skipPowerUpMultipliers

bool PlatformerPro.Movement.skipPowerUpMultipliers

If true don't apply power-up multipliers to this movement.

◆ skipUpgradeMultipliers

bool PlatformerPro.Movement.skipUpgradeMultipliers

If true don't apply upgrade multipliers to this movement.

Property Documentation

◆ AnimationPriority

virtual int PlatformerPro.Movement.AnimationPriority
get

Gets the priority of the animation state that this movement wants to set.

◆ AnimationState

virtual AnimationState PlatformerPro.Movement.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Character

virtual Character PlatformerPro.Movement.Character
get

Sets the character for this movement.

◆ CurrentGravity

virtual float PlatformerPro.Movement.CurrentGravity
get

Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()

◆ Enabled

virtual bool PlatformerPro.Movement.Enabled
getset

A custom enable which base movements can use to pass on enable values.

The enabled.

◆ FacingDirection

virtual int PlatformerPro.Movement.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left.

◆ Implementation

virtual Movement PlatformerPro.Movement.Implementation
get

Gets the underlying implementation (if not overridden return itself).

The implementation.

◆ Info

MovementInfo PlatformerPro.Movement.Info
staticget

Static movement info used by the editor.

◆ OverrideState

virtual string PlatformerPro.Movement.OverrideState
get

Gets the animation override state that this movement wants to set.

◆ PreventXVelocityReset

virtual bool PlatformerPro.Movement.PreventXVelocityReset
get

If true then don't allow base collisions to reset velocity in X.

◆ ShouldApplyGravity

virtual bool PlatformerPro.Movement.ShouldApplyGravity
get

Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes.

◆ ShouldDoBaseCollisions

virtual RaycastType PlatformerPro.Movement.ShouldDoBaseCollisions
get

Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes.

◆ ShouldDoRotations

virtual bool PlatformerPro.Movement.ShouldDoRotations
get

Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character.

◆ VelocityType

virtual VelocityType PlatformerPro.Movement.VelocityType
get

How does this movement use Velocity.


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