![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
A grappling hook with various options. More...
Public Member Functions | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement 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 | DoSpecialMove () |
Start the special mvoe More... | |
virtual void | Latch () |
Called by the hook when it latches on to something. More... | |
virtual void | CancelGrapple () |
Cancels the grapple. More... | |
override void | DoMove () |
Moves the character. More... | |
override void | LosingControl () |
Called when the movement loses control. 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 | |
Vector2 | handOffset |
Distance between characters transform and their hand. More... | |
float | maxDistance |
The max distance the rope can travel. More... | |
GrapplingHookControlType | controlType |
How we control the grapple. More... | |
bool | canLaunchWhenGrounded |
Can we launch the grapple when gorunded? More... | |
float | retractSpeed |
Speed at which the hook retracts (i.e speed which played moves up/down). More... | |
Vector2 | launchVelocityBoost |
The additional boost we add to the swing velocity when player leaves grapple. More... | |
Vector2 | launchVelocityMultiplier |
The additional multiplier applied swing velocity when player leaves grapple. More... | |
float | slingshotRetractSpeed |
Speed at which the hook retracts (i.e speed which played moves up/down). More... | |
Vector2 | slingshotLaunchVelocity |
Speed at which we slingshot. More... | |
float | drag |
When retracting by how much do we speed up the swing? More... | |
float | gravity |
Gravity to use when swinging. More... | |
GameObject | grapplePrefab |
Prefab to use for the grapple. More... | |
GameObject | ropePrefab |
Prefab to use for the rope. More... | |
SlowDownType | slowDownType |
How do we slow down? More... | |
Protected Member Functions | |
virtual ButtonState | GetGrappleButtonState () |
Determines state of grapple button. More... | |
virtual void | HandleInputs () |
Handle inputs during the grapple More... | |
virtual void | FireGrapple () |
Fires the grapple. More... | |
virtual void | DoRetract (int retractDirection) |
Does the retracting More... | |
virtual void | DoSlingShot () |
Launches the player with slingshot velocity More... | |
virtual void | DrawRope () |
Draws the rope. More... | |
virtual bool | WouldHitSides () |
Are we hitting our sides? If so cancel grapple. More... | |
virtual void | DoSwing () |
Does the swinging movement More... | |
Protected Attributes | |
ProjectileAimer | aimer |
Cached reference to the projectile aimer. More... | |
GrapplingHookProjectile | grapple |
Actual grappling hook. More... | |
GrapplingHookState | state |
The state. More... | |
bool | hasLeftGround |
Tracks if we have left the ground. More... | |
float | ropeDistance |
Current distance between player and rope. More... | |
float | buttonHeldTimer |
Slingshot after this timer reaches threshold. More... | |
bool | buttonReleased |
Checks if the button is being held. More... | |
bool | buttonHoldStarted |
Have we started to hold button. More... | |
GameObject | ropeGo |
Gameobject for the rope. More... | |
Vector2 | direction |
Direction from character to grapple. More... | |
float | travelledDistance |
Tracks how far we have travelled up the rope since slingshot started. More... | |
float | slingshotLaunchDistance |
Tracks the distance we have to travel before we slingshot. More... | |
float | maxRopeDistance |
The max rope distance. More... | |
float | swingTime |
Time we have been swinging for. 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 | HandOffsetIndex = 0 |
The index of the hand offset in the movement data. More... | |
const int | MaxDistanceIndex = 1 |
The index of the max distance in the movement data. More... | |
const int | ControlTypeIndex = 2 |
The index of the control type in the movement data. More... | |
const int | RetractSpeedIndex = 3 |
The index of the retract speed in the movement data. More... | |
const int | GravityIndex = 4 |
The index of the gravity in the movement data. More... | |
const int | GrapplePrefabIndex = 5 |
The index of the grapple prefab in the movement data. More... | |
const int | RopePrefabIndex = 6 |
The index of the rope prefab in the movement data. More... | |
const int | SlowDownTypeIndex = 7 |
The index of the slow down type in the movement data. More... | |
const int | DragIndex = 8 |
The index of the drag in the movement data. More... | |
const int | SlingshotRetractSpeedIndex = 9 |
The index of the slingshot retract speed value in the movement data. More... | |
const int | SlingshotLaunchVelocityIndex = 10 |
The index of the slingshot launch velocity. More... | |
const int | CanLaunchWhenGroundedIndex = 11 |
The index of can launch when grounded. More... | |
const int | LaunchVelocityBoostIndex = 12 |
The index of launch velocity boost in the movement data. More... | |
const int | LaunchVelocityMultiplierIndex = 13 |
The index of launch velocity multiplier in the movement data. More... | |
const int | MovementVariableCount = 14 |
The size of the movement variable array in the movement data. More... | |
const float | DefaultMaxDistance = 5.0f |
The default max distance. More... | |
const GrapplingHookControlType | DefaultControlType = GrapplingHookControlType.AUTO_RETRACT |
The default type of the control. More... | |
const float | DefaultRetractSpeed = 10.0f |
The default retract speed. More... | |
const float | DefaultGravity = -50f |
The default gravity. More... | |
const float | buttonHeldTime = 0.25f |
The button held time. More... | |
static Vector2 | DefaultLaunchVelocityBoost = new Vector2(2.0f, 2.0f) |
The default launch velocity boost. More... | |
const float | MaxRopeSlingshotDistance = 2.5f |
Maximum distance after which you will always slingshot. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
override bool | ShouldApplyGravity [get] |
This class will handle gravity internally. 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 velocity direction. More... | |
Vector2 | HandOffset [get] |
Gets the hand offset offset for facing direction. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. 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 grappling hook with various options.
|
virtual |
Cancels the grapple.
override void PlatformerPro.SpecialMovement_GrapplingHook.DoMove | ( | ) |
Moves the character.
|
protectedvirtual |
Does the retracting
retractDirection | Retract direction, 1 for up -1 for down. |
|
protectedvirtual |
Launches the player with slingshot velocity
|
virtual |
Start the special mvoe
Reimplemented from PlatformerPro.SpecialMovement.
|
protectedvirtual |
Does the swinging movement
|
protectedvirtual |
Draws the rope.
|
protectedvirtual |
Fires the grapple.
|
protectedvirtual |
Determines state of grapple button.
|
protectedvirtual |
Handle inputs during the grapple
override Movement PlatformerPro.SpecialMovement_GrapplingHook.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
|
virtual |
Called by the hook when it latches on to something.
override void PlatformerPro.SpecialMovement_GrapplingHook.LosingControl | ( | ) |
Called when the movement loses control.
|
virtual |
Gets a value indicating whether this movement wants to do a special move.
Reimplemented from PlatformerPro.SpecialMovement.
|
protectedvirtual |
Are we hitting our sides? If so cancel grapple.
|
protected |
Cached reference to the projectile aimer.
|
staticprotected |
The button held time.
ns
|
protected |
Slingshot after this timer reaches threshold.
|
protected |
Have we started to hold button.
|
protected |
Checks if the button is being held.
bool PlatformerPro.SpecialMovement_GrapplingHook.canLaunchWhenGrounded |
Can we launch the grapple when gorunded?
|
staticprotected |
The index of can launch when grounded.
GrapplingHookControlType PlatformerPro.SpecialMovement_GrapplingHook.controlType |
How we control the grapple.
|
staticprotected |
The index of the control type in the movement data.
|
staticprotected |
The default type of the control.
|
staticprotected |
The default gravity.
|
staticprotected |
The default launch velocity boost.
|
staticprotected |
The default max distance.
|
staticprotected |
The default retract speed.
|
protected |
Direction from character to grapple.
float PlatformerPro.SpecialMovement_GrapplingHook.drag |
When retracting by how much do we speed up the swing?
|
staticprotected |
The index of the drag in the movement data.
|
protected |
Actual grappling hook.
GameObject PlatformerPro.SpecialMovement_GrapplingHook.grapplePrefab |
Prefab to use for the grapple.
|
staticprotected |
The index of the grapple prefab in the movement data.
float PlatformerPro.SpecialMovement_GrapplingHook.gravity |
Gravity to use when swinging.
|
staticprotected |
The index of the gravity in the movement data.
Vector2 PlatformerPro.SpecialMovement_GrapplingHook.handOffset |
Distance between characters transform and their hand.
|
staticprotected |
The index of the hand offset in the movement data.
|
protected |
Tracks if we have left the ground.
Vector2 PlatformerPro.SpecialMovement_GrapplingHook.launchVelocityBoost |
The additional boost we add to the swing velocity when player leaves grapple.
|
staticprotected |
The index of launch velocity boost in the movement data.
Vector2 PlatformerPro.SpecialMovement_GrapplingHook.launchVelocityMultiplier |
The additional multiplier applied swing velocity when player leaves grapple.
|
staticprotected |
The index of launch velocity multiplier in the movement data.
float PlatformerPro.SpecialMovement_GrapplingHook.maxDistance |
The max distance the rope can travel.
|
staticprotected |
The index of the max distance in the movement data.
|
protected |
The max rope distance.
|
staticprotected |
Maximum distance after which you will always slingshot.
|
staticprotected |
The size of the movement variable array in the movement data.
float PlatformerPro.SpecialMovement_GrapplingHook.retractSpeed |
Speed at which the hook retracts (i.e speed which played moves up/down).
|
staticprotected |
The index of the retract speed in the movement data.
|
protected |
Current distance between player and rope.
|
protected |
Gameobject for the rope.
GameObject PlatformerPro.SpecialMovement_GrapplingHook.ropePrefab |
Prefab to use for the rope.
|
staticprotected |
The index of the rope prefab in the movement data.
|
protected |
Tracks the distance we have to travel before we slingshot.
Vector2 PlatformerPro.SpecialMovement_GrapplingHook.slingshotLaunchVelocity |
Speed at which we slingshot.
|
staticprotected |
The index of the slingshot launch velocity.
float PlatformerPro.SpecialMovement_GrapplingHook.slingshotRetractSpeed |
Speed at which the hook retracts (i.e speed which played moves up/down).
|
staticprotected |
The index of the slingshot retract speed value in the movement data.
SlowDownType PlatformerPro.SpecialMovement_GrapplingHook.slowDownType |
How do we slow down?
|
staticprotected |
The index of the slow down type in the movement data.
|
protected |
The state.
|
protected |
Time we have been swinging for.
|
protected |
Tracks how far we have travelled up the rope since slingshot started.
|
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 velocity direction.
|
getprotected |
Gets the hand offset offset for facing direction.
The hand offset.
|
staticget |
Static movement info used by the editor.
|
get |
This class will handle gravity internally.