Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.BaseMovement< T > Class Template Reference

A wrapper class for handling movement that proxies the movement function to the desired implementation. More...

Inheritance diagram for PlatformerPro.BaseMovement< T >:
PlatformerPro.Movement

Public Member Functions

sealed override Movement Init (Character character)
 Initialise this movement. More...
 
bool IsMovementDataDifferent (MovementVariable[] originalMovementData)
 Determines whether this instances movement data is different from the supplied originalMovementData. More...
 
- Public Member Functions inherited from PlatformerPro.Movement
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...
 

Protected Attributes

Movement implementation
 The class that will do the movement. More...
 
string movementType
 The type of movement as a string. More...
 
MovementVariable[] movementData
 Data that should be applied to the movement type on init. More...
 
- Protected Attributes inherited from PlatformerPro.Movement
Character character
 Cached reference to the character. More...
 
AdditionalCondition[] conditions
 Cached list of all additional conditions. More...
 

Properties

virtual string MovementType [get, set]
 The type of movement as a string. More...
 
virtual MovementVariable[] MovementData [get, set]
 Data that should be applied to the movement type on init. More...
 
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool Enabled [get, set]
 A custom enable which base movements can use to pass on enable values. More...
 
override Movement Implementation [get]
 Gets the underlying implementation. More...
 
- Properties inherited from PlatformerPro.Movement
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from PlatformerPro.Movement
static bool CheckSideCollisions (Character character, int requiredHits, RaycastType types)
 Utility method which checks for side collissions. More...
 
- Public Attributes inherited from PlatformerPro.Movement
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 inherited from PlatformerPro.Movement
void AssignReferences (Character character)
 Initialise this movement and return a reference to the ready to use movement. More...
 

Detailed Description

A wrapper class for handling movement that proxies the movement function to the desired implementation.

Type Constraints
T :Movement 

Member Function Documentation

◆ Init()

sealed override Movement PlatformerPro.BaseMovement< T >.Init ( Character  character)
virtual

Initialise this movement.

Reimplemented from PlatformerPro.Movement.

◆ IsMovementDataDifferent()

bool PlatformerPro.BaseMovement< T >.IsMovementDataDifferent ( MovementVariable[]  originalMovementData)

Determines whether this instances movement data is different from the supplied originalMovementData.

Returns
true if this instances movement data different the specified originalMovementData; otherwise, false.
Parameters
originalMovementDataOriginal movement data.

Member Data Documentation

◆ implementation

Movement PlatformerPro.BaseMovement< T >.implementation
protected

The class that will do the movement.

◆ movementData

MovementVariable [] PlatformerPro.BaseMovement< T >.movementData
protected

Data that should be applied to the movement type on init.

◆ movementType

string PlatformerPro.BaseMovement< T >.movementType
protected

The type of movement as a string.

Property Documentation

◆ Enabled

override bool PlatformerPro.BaseMovement< T >.Enabled
getset

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

The enabled.

◆ Implementation

override Movement PlatformerPro.BaseMovement< T >.Implementation
get

Gets the underlying implementation.

The implementation.

◆ Info

new static MovementInfo PlatformerPro.BaseMovement< T >.Info
staticget

Static movement info used by the editor.

◆ MovementData

virtual MovementVariable [] PlatformerPro.BaseMovement< T >.MovementData
getset

Data that should be applied to the movement type on init.

◆ MovementType

virtual string PlatformerPro.BaseMovement< T >.MovementType
getset

The type of movement as a string.


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