![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
A wall movement class that grabs a ledge and climbs up it. More...
Public Member Functions | |
override void | DoMove () |
Moves the character. More... | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement with the given movement data. More... | |
override bool | WantsCling () |
Gets a value indicating whether this movement wants to intiate a wall clinging behaviour. More... | |
override void | DoCling () |
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. In this case control unless the character dismounts. More... | |
override void | LosingControl () |
Called when the movement loses control. Override to do any reset type actions. You should ensure that character velocity is reset back to world-relative velocity here. 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 | |
LedgeDetectionType | ledgeDetectionType |
How do we detect if wall is actually a ledge. More... | |
GapDetectionType | gapDetectionType |
How do we detect if there is a gap the character can move through. More... | |
LedgeClimbAnimationTargetting | animationTargetting |
How do we target the character at the ledge. More... | |
float | fallTime = 0.33f |
How long to fall from the ledge wihtout rechecking for ledge. Used to ensure the character can't regrab the ledge they just fell from. More... | |
float | maxGraspLeeway |
Maximum distance below the ledge at which the character can move from reach to grasp. More... | |
float | minGraspLeeway |
Minimum distance below the ledge at which the character can move from reach to grasp. More... | |
float | minReachTime |
How long (in seconds) must a character reach out for the ledge before the are allowed to grab it. More... | |
Protected Member Functions | |
virtual bool | CheckLedge () |
Checks the ledge using the selected ledge dection type. More... | |
virtual bool | CheckGap () |
Checked for a gap using the selected gap detection type. More... | |
virtual bool | DoGapDectionFromSideColliders () |
Check for a gap by casting rays extending along the side colldiers. More... | |
virtual void | CheckForAnimationStateTransition () |
Checks for animation state transition. I.e. when ledge climb state should be changed based on the animation state. More... | |
virtual void | MoveToHangPosition () |
Transform the character to the correct hang position so the hands are hanging form the edge More... | |
virtual void | MoveToDismountPosition () |
When dismounting we do the opposite of move to hang. More... | |
virtual bool | CheckGraspLeeway (bool checkMin) |
Checks the grasp leeway. More... | |
virtual bool | CheckForGrab () |
Check if a grasp should become a grab. More... | |
virtual bool | UserPressingFallKey () |
Is the user pressing a key that causes them to fall. More... | |
virtual bool | UserPressingClimbKey () |
Is the user pressing a key that causes them to climb. More... | |
Protected Attributes | |
Vector2 | ledgeOffset |
Stores the offset for the ledge when in BOX mode. More... | |
Vector2 | standOffset |
Stores the offset for the standing position. More... | |
Vector2 | dismountOffset |
Stores the offset for the dismount position. More... | |
HumanBodyBones | graspingBone |
Bone to use for BONE targetting while grasping. More... | |
LedgeClimbState | ledgeClimbState |
Current state of the ledge climb. More... | |
Animator | myAnimator |
If the animator drives animation state then keep a cached copy. More... | |
SpriteRenderer | myRenderer |
int | facingDirection |
Cache the facing direction. More... | |
float | fallTimer |
While this is bigger than true ignore all ledge grabs (becasue the user told us to drop). More... | |
float | reachTimer |
Determines how long we have been reaching for a ledge. More... | |
Vector2 | initialSpritePivot |
Cached position of the inital sprite pivot. More... | |
Collider2D | currentWall |
Cached copy of the ledge climb wall. More... | |
Vector2 | currentTransformOffset |
Defines the current offset as an offset from the current wall. 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 float | DefaultMinReachTime = 0.1f |
The default minimum reach time. More... | |
const int | LedgeDetectionTypeIndex = 2 |
The index of the property for ledge detection type. More... | |
const int | GapDetectionTypeIndex = 3 |
The index of the property for gap detection type. More... | |
const int | AnimationTargettingIndex = 4 |
The index of the animation target type. More... | |
const int | LedgeOffsetIndex = 5 |
The index of the ledge offset. More... | |
const int | GraspingBoneIndex = 6 |
The index of the grasping bone. More... | |
const int | StandOffsetIndex = 7 |
The index of the stand offset. More... | |
const int | MaxGraspLeewayIndex = 8 |
The index of the max grasp leeway. More... | |
const int | MinGraspLeewayIndex = 9 |
The index of the minimum grasp leeway. More... | |
const int | MinReachTimeIndex = 10 |
The index of the minimum reach time. More... | |
const int | FallTimeIndex = 11 |
The index of the fall time. More... | |
const int | DismountOffsetIndex = 12 |
The index of the dismount offset. More... | |
new const int | MovementVariableCount = 13 |
The size of the movement variable array. More... | |
![]() | |
const int | RequiredCollidersIndex = 1 |
The index of the property for the required colliders. /// More... | |
const int | MovementVariableCount = 2 |
The size of the movement variable array. More... | |
const int | DefaultRequiredColliders = 2 |
The index of the property for the required colliders. /// More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
Vector2 | CurrentLedgePosition [get] |
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. This overriden version always returns the wall direction. More... | |
override RaycastType | ShouldDoBaseCollisions [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. More... | |
override bool | ShouldDoRotations [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. More... | |
override bool | ShouldApplyGravity [get] |
Gravity handled internally More... | |
![]() | |
virtual bool | ClingToAllWalls [get, protected set] |
If true this applies to all walls and there is no need to use tags or layers to detect walls. More... | |
virtual bool | DetectWallsByTag [get, protected set] |
Should we find walls by tag or by layer. If true we will use tags, if false we will use layers. Tags are easier to use but come with an allocation cost. More... | |
virtual string | WallLayerOrTagName [get, protected set] |
The name of the wall layer if we find by layers, or the tag name if we find by tags. More... | |
virtual int | RequiredColliders [get, protected set] |
The number of colliders required for wall clinging to intiate. Note these colliders don't need to be hitting the same wall just a wall on the same side (so you can move up a wall made of tiled boxes). More... | |
override bool | ShouldDoRotations [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. By default walls don't do this. 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 wall movement class that grabs a ledge and climbs up it.
|
protectedvirtual |
Checks for animation state transition. I.e. when ledge climb state should be changed based on the animation state.
Don't do this transition in baked mode as we need to apply the transform in LateUpdate instead
|
protectedvirtual |
Check if a grasp should become a grab.
true
, if we should grab, false
otherwise.
|
protectedvirtual |
Checked for a gap using the selected gap detection type.
true
, if gap was checked, false
otherwise.
|
protectedvirtual |
Checks the grasp leeway.
true
, if grasp leeway was checked, false
otherwise.checkMin | If set to true check min constraint else just check max. |
|
protectedvirtual |
Checks the ledge using the selected ledge dection type.
true
, if ledge was found, false
otherwise.
|
virtual |
Does the cling.
Reimplemented from PlatformerPro.WallMovement.
|
protectedvirtual |
Check for a gap by casting rays extending along the side colldiers.
true
, if gap dection from side colliders was done, false
otherwise.override void PlatformerPro.WallMovement_LedgeClimb.DoMove | ( | ) |
Moves the character.
override bool PlatformerPro.WallMovement_LedgeClimb.ForceMaintainControl | ( | ) |
If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. In this case control unless the character dismounts.
override Movement PlatformerPro.WallMovement_LedgeClimb.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
override void PlatformerPro.WallMovement_LedgeClimb.LosingControl | ( | ) |
Called when the movement loses control. Override to do any reset type actions. You should ensure that character velocity is reset back to world-relative velocity here.
|
protectedvirtual |
When dismounting we do the opposite of move to hang.
|
protectedvirtual |
Transform the character to the correct hang position so the hands are hanging form the edge
|
protectedvirtual |
Is the user pressing a key that causes them to climb.
true
, if user pressing a climb key, false
otherwise.
|
protectedvirtual |
Is the user pressing a key that causes them to fall.
true
, if user pressing a fall key, false
otherwise.
|
virtual |
Gets a value indicating whether this movement wants to intiate a wall clinging behaviour.
Reimplemented from PlatformerPro.WallMovement.
LedgeClimbAnimationTargetting PlatformerPro.WallMovement_LedgeClimb.animationTargetting |
How do we target the character at the ledge.
|
staticprotected |
The index of the animation target type.
|
protected |
Defines the current offset as an offset from the current wall.
|
protected |
Cached copy of the ledge climb wall.
|
staticprotected |
The default minimum reach time.
|
protected |
Stores the offset for the dismount position.
|
staticprotected |
The index of the dismount offset.
|
protected |
Cache the facing direction.
float PlatformerPro.WallMovement_LedgeClimb.fallTime = 0.33f |
How long to fall from the ledge wihtout rechecking for ledge. Used to ensure the character can't regrab the ledge they just fell from.
|
staticprotected |
The index of the fall time.
|
protected |
While this is bigger than true ignore all ledge grabs (becasue the user told us to drop).
GapDetectionType PlatformerPro.WallMovement_LedgeClimb.gapDetectionType |
How do we detect if there is a gap the character can move through.
|
staticprotected |
The index of the property for gap detection type.
|
protected |
Bone to use for BONE targetting while grasping.
|
staticprotected |
The index of the grasping bone.
|
protected |
Cached position of the inital sprite pivot.
|
protected |
Current state of the ledge climb.
LedgeDetectionType PlatformerPro.WallMovement_LedgeClimb.ledgeDetectionType |
How do we detect if wall is actually a ledge.
|
staticprotected |
The index of the property for ledge detection type.
|
protected |
Stores the offset for the ledge when in BOX mode.
|
staticprotected |
The index of the ledge offset.
float PlatformerPro.WallMovement_LedgeClimb.maxGraspLeeway |
Maximum distance below the ledge at which the character can move from reach to grasp.
|
staticprotected |
The index of the max grasp leeway.
float PlatformerPro.WallMovement_LedgeClimb.minGraspLeeway |
Minimum distance below the ledge at which the character can move from reach to grasp.
|
staticprotected |
The index of the minimum grasp leeway.
float PlatformerPro.WallMovement_LedgeClimb.minReachTime |
How long (in seconds) must a character reach out for the ledge before the are allowed to grab it.
|
staticprotected |
The index of the minimum reach time.
|
staticprotected |
The size of the movement variable array.
|
protected |
If the animator drives animation state then keep a cached copy.
|
protected |
|
protected |
Determines how long we have been reaching for a ledge.
|
protected |
Stores the offset for the standing position.
|
staticprotected |
The index of the stand offset.
|
get |
Gets the animation state that this movement wants to set.
|
getprotected |
|
get |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the wall direction.
|
staticget |
Static movement info used by the editor.
|
get |
Gravity handled internally
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes.
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character.