![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
A special movement which starts the character swimming when the enter the water. More...
Public Member Functions | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the mvoement with the given movement data. More... | |
override bool | WantsSpecialMove () |
Gets a value indicating whether this movement wants to do a special move. More... | |
override void | DoMove () |
Moves the character. More... | |
override 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... | |
override void | LosingControl () |
Called when the movement loses control. Override to do any reset type actions. More... | |
virtual void | StartSwim () |
Starts the swim. More... | |
virtual void | StopSwim () |
Stops the swim. More... | |
virtual void | SurfaceSwim () |
Starts Surface Swim. More... | |
virtual void | EndSurfaceSwim () |
Ends Surface Swim. More... | |
![]() | |
virtual void | DoSpecialMove () |
Start the special mvoe More... | |
![]() | |
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 Attributes | |
float | swimGravity |
Gravity to apply when swimming. Usually much lower than standard gravity, More... | |
float | swimTerminalVelocity |
Maximum speed of descent when swimming. Usually much lower than the standard terminal velocity. More... | |
float | strokeSpeed |
How long does a swimming stroke say. 2.0 would mean the character can stroke every 2 seconds. More... | |
Vector2 | strokeAcceleration |
The stroke acceleration. X value is switched based on facing direction. More... | |
float | maxSpeedInX |
Maximum x speed. More... | |
float | xAcceleration |
How fast do we accelerate in X. More... | |
float | drag |
X drag. More... | |
bool | useGroundMovementWhenGrounded |
If the character is on the ground when underwater should they use the default ground movement. If false they will always swim. More... | |
Protected Member Functions | |
virtual void | MoveInX () |
Handle X movement More... | |
virtual void | MoveInY () |
Protected Attributes | |
bool | swimStarted |
Tracks if we are swimming or not. More... | |
float | swimStrokeTimer |
The swim stroke timer, can't stroke until this is less than or equal to 0. More... | |
bool | isOnSurface |
Tracks if we are on surface of water or not. More... | |
![]() | |
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... | |
Static Protected Attributes | |
const int | SwimGravityIndex = 0 |
The index of the swim gravity. More... | |
const int | SwimTerminalVelocityIndex = 1 |
The index of the swim terminal velocity. More... | |
const int | StrokeSpeedIndex = 2 |
The index of the stroke speed. More... | |
const int | StrokeAccelerationIndex = 3 |
The index of the stroke acceleration. More... | |
const int | MaxSpeedInXIndex = 4 |
The index of the max speed in X. More... | |
const int | XAccelerationIndex = 5 |
The index of the X acceleration. More... | |
const int | DragIndex = 6 |
The index of the drag. More... | |
const int | UseGroundMovementWhenGroundedIndex = 7 |
The index of the use ground movement when grounded. More... | |
const int | MovementVariableCount = 8 |
The size of the movement variable array. More... | |
const float | DefaultDrag = 4.0f |
The default drag. More... | |
const float | DefaultAcceleration = 12.0f |
The default acceleration. More... | |
const float | DefaultMaxSpeed = 4.0f |
The default max speed. More... | |
const float | DefaultSwimGravity = -6.0f |
The default swim gravity. More... | |
const float | DefaultTerminalVelocity = -3.5f |
The default terminal speed. More... | |
const float | DefaultStrokeSpeed = 0.75f |
The default stroke speed. More... | |
static Vector2 | DefaultStrokeAcceleration = new Vector2 (5, 3.5f) |
The default stroke acceleration. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
virtual bool | OnSurface [get] |
Gets a value indicating whether this PlatformerPro.SpecialMovement_Swim is swimming on surface. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
override int | AnimationPriority [get] |
Gets the priority of the animation state that this movement wants to set. More... | |
override bool | ShouldApplyGravity [get] |
Shoulds the apply gravity. More... | |
override RaycastType | ShouldDoBaseCollisions [get] |
Gets the should do base collisions. More... | |
override int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the input direction. More... | |
![]() | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
![]() | |
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... | |
A special movement which starts the character swimming when the enter the water.
override void PlatformerPro.SpecialMovement_Swim.DoMove | ( | ) |
Moves the character.
|
virtual |
Ends Surface Swim.
Reimplemented in PlatformerPro.SpecialMovement_DirectionalSwim.
override bool PlatformerPro.SpecialMovement_Swim.ForceMaintainControl | ( | ) |
If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't.
true
if control is wanted, false
otherwise.override Movement PlatformerPro.SpecialMovement_Swim.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
override void PlatformerPro.SpecialMovement_Swim.LosingControl | ( | ) |
Called when the movement loses control. Override to do any reset type actions.
|
protectedvirtual |
Handle X movement
|
protectedvirtual |
|
virtual |
Starts the swim.
Reimplemented in PlatformerPro.SpecialMovement_DirectionalSwim.
|
virtual |
Stops the swim.
|
virtual |
Starts Surface Swim.
Reimplemented in PlatformerPro.SpecialMovement_DirectionalSwim.
|
virtual |
Gets a value indicating whether this movement wants to do a special move.
true
if this instance wants control; otherwise, false
.
Reimplemented from PlatformerPro.SpecialMovement.
|
staticprotected |
The default acceleration.
|
staticprotected |
The default drag.
|
staticprotected |
The default max speed.
|
staticprotected |
The default stroke acceleration.
|
staticprotected |
The default stroke speed.
|
staticprotected |
The default swim gravity.
|
staticprotected |
The default terminal speed.
float PlatformerPro.SpecialMovement_Swim.drag |
X drag.
|
staticprotected |
The index of the drag.
|
protected |
Tracks if we are on surface of water or not.
float PlatformerPro.SpecialMovement_Swim.maxSpeedInX |
Maximum x speed.
|
staticprotected |
The index of the max speed in X.
|
staticprotected |
The size of the movement variable array.
Vector2 PlatformerPro.SpecialMovement_Swim.strokeAcceleration |
The stroke acceleration. X value is switched based on facing direction.
|
staticprotected |
The index of the stroke acceleration.
float PlatformerPro.SpecialMovement_Swim.strokeSpeed |
How long does a swimming stroke say. 2.0 would mean the character can stroke every 2 seconds.
|
staticprotected |
The index of the stroke speed.
float PlatformerPro.SpecialMovement_Swim.swimGravity |
Gravity to apply when swimming. Usually much lower than standard gravity,
|
staticprotected |
The index of the swim gravity.
|
protected |
Tracks if we are swimming or not.
|
protected |
The swim stroke timer, can't stroke until this is less than or equal to 0.
float PlatformerPro.SpecialMovement_Swim.swimTerminalVelocity |
Maximum speed of descent when swimming. Usually much lower than the standard terminal velocity.
|
staticprotected |
The index of the swim terminal velocity.
bool PlatformerPro.SpecialMovement_Swim.useGroundMovementWhenGrounded |
If the character is on the ground when underwater should they use the default ground movement. If false they will always swim.
|
staticprotected |
The index of the use ground movement when grounded.
float PlatformerPro.SpecialMovement_Swim.xAcceleration |
How fast do we accelerate in X.
|
staticprotected |
The index of the X acceleration.
|
get |
Gets the priority of the animation state that this movement wants to set.
The animation priority.
|
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. This overriden version always returns the input direction.
|
staticget |
Static movement info used by the editor.
|
get |
Gets a value indicating whether this PlatformerPro.SpecialMovement_Swim is swimming on surface.
true
if on surface; otherwise, false
.
|
get |
Shoulds the apply gravity.
true
, if apply gravity was shoulded, false
otherwise.
|
get |
Gets the should do base collisions.
The should do base collisions.