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

Projectile used for grappling hook. More...

Inheritance diagram for PlatformerPro.GrapplingHookProjectile:
PlatformerPro.Projectile PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

override void Fire (int damageAmount, DamageType damageType, Vector2 direction, IMob character, float charge=1.0f)
 Call to start the projectile moving. More...
 
virtual void Hide ()
 Force the grapple from view. More...
 
override void DestroyProjectile (bool isEnemyHit)
 Destroy projectile or latch if we hit scenerey. More...
 
virtual void SetCollider (Collider2D collider)
 
- Public Member Functions inherited from PlatformerPro.Projectile
virtual void Finish ()
 End the characters attack, for most projectiles you will ignore this, but it may be useful for some movement types. More...
 
override void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Public Attributes

GameObject visualComponent
 The visual component of the hook that is disabled when not visible and enabled when visible. More...
 
float projectileDelay = 0.05f
 Delay before making projectile visible. More...
 
bool shouldParent = true
 If true grapple will parent to the thing it collides with. Required for grappling on to moving platforms. More...
 
- Public Attributes inherited from PlatformerPro.Projectile
bool destroyOnEnemyHit
 Should this object be destroyed when this object hits an enemy? More...
 
bool destroyOnSceneryHit
 Should this object be destroyed when this object hits scenery? More...
 
float speed
 How fast the projectile moves. More...
 
ProjectileHitBox projectileHitBox
 The hit box that causes damage to enemies. More...
 
float autoExplodeDelay
 How long after projectile fires should we wait before automatically exploding it. 0 Means it wont explodes until it hits something. More...
 
float destroyDelay
 How long after projectile collides should we wait before destroying it. More...
 
bool rotate = true
 Should the projectile be rotated to face the direction of travel. More...
 
GameObject visibleComponents
 If non-null then this GameObject will ne turned on when the projectile is fired. Used for syncing projectile visuals with animation events. More...
 
Vector2 direction
 Movement direction. More...
 

Protected Member Functions

virtual IEnumerator DelayVisualComponent ()
 Delays making componet visible until delay is reached. More...
 
- Protected Member Functions inherited from PlatformerPro.Projectile
virtual void OnProjectileFired ()
 Raises the projectile fired event. More...
 
virtual void OnProjectileDestroyed (DamageInfo info)
 Raises the projectile destroyed event. More...
 
virtual void Move ()
 Move the projectile, override if you want custom movement. More...
 
virtual int CalculateDamageAmount (int damageAmount, float charge)
 Calculates the actual damage amount. More...
 
virtual float CalculateSpeed (float charge)
 Calculates the actual speed. More...
 
virtual IEnumerator DoDestroy (bool isEnemyHit)
 Sends the destory event, then waits for detroy delay, then destroys GO. More...
 

Protected Attributes

bool hasLatched
 Have we latched. More...
 
Collider2D currentLatchedCollider
 The current collider we are latched to. More...
 
SpecialMovement_GrapplingHook movement
 The movement that launched us. More...
 
- Protected Attributes inherited from PlatformerPro.Projectile
DamageInfo damageInfo
 Damage this projectile will cause. More...
 
bool fired
 Have we been fired? More...
 
float actualSpeed
 The actual speed. More...
 
float remainingLifetime
 How long before we destory this bullet. More...
 
Rigidbody2D myRigidbody
 Cached rigidbody. IF a non-kinematic rigidboy is attached we launch by setting velocity and do not move each frame. More...
 

Properties

bool IsVisible [get]
 Can we see the projectile? More...
 
- Properties inherited from PlatformerPro.Projectile
override string Header [get]
 
float Charge [get, protected set]
 Gets the charge which can be used by effects, etc. More...
 
int ChargeLevel [get, protected set]
 Gets the charge as an int which can be used by effects, etc. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual string Header [get]
 Gets the header string used to describe the component. More...
 
virtual string DocLink [get]
 Gets a link to documentation site. More...
 
virtual string VideoLink [get]
 Gets a link to a youtube video. More...
 
virtual string Deprecated [get]
 If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
 

Additional Inherited Members

- Events inherited from PlatformerPro.Projectile
System.EventHandler< EmptyEventArgsProjectileFired
 Event for when a projectile is fired. Typically used for enabling effects. More...
 
System.EventHandler< DamageInfoEventArgsProjectileDestroyed
 Event for when a projectile crashes in to something. If the object being crashed in to is not an enemy then the damage info will be null. More...
 

Detailed Description

Projectile used for grappling hook.

Member Function Documentation

◆ DelayVisualComponent()

virtual IEnumerator PlatformerPro.GrapplingHookProjectile.DelayVisualComponent ( )
protectedvirtual

Delays making componet visible until delay is reached.

Returns
The visual component.

◆ DestroyProjectile()

override void PlatformerPro.GrapplingHookProjectile.DestroyProjectile ( bool  isEnemyHit)
virtual

Destroy projectile or latch if we hit scenerey.

Reimplemented from PlatformerPro.Projectile.

◆ Fire()

override void PlatformerPro.GrapplingHookProjectile.Fire ( int  damageAmount,
DamageType  damageType,
Vector2  direction,
IMob  character,
float  charge = 1.0f 
)
virtual

Call to start the projectile moving.

Parameters
damageAmountDamage amount.
damageTypeDamage type.
directionDirection of fire
characterCharacter doing the firing.
chargeHow charged is the attack. Ignored by grappling hooks.

Reimplemented from PlatformerPro.Projectile.

◆ Hide()

virtual void PlatformerPro.GrapplingHookProjectile.Hide ( )
virtual

Force the grapple from view.

◆ SetCollider()

virtual void PlatformerPro.GrapplingHookProjectile.SetCollider ( Collider2D  collider)
virtual

Member Data Documentation

◆ currentLatchedCollider

Collider2D PlatformerPro.GrapplingHookProjectile.currentLatchedCollider
protected

The current collider we are latched to.

◆ hasLatched

bool PlatformerPro.GrapplingHookProjectile.hasLatched
protected

Have we latched.

◆ movement

SpecialMovement_GrapplingHook PlatformerPro.GrapplingHookProjectile.movement
protected

The movement that launched us.

◆ projectileDelay

float PlatformerPro.GrapplingHookProjectile.projectileDelay = 0.05f

Delay before making projectile visible.

◆ shouldParent

bool PlatformerPro.GrapplingHookProjectile.shouldParent = true

If true grapple will parent to the thing it collides with. Required for grappling on to moving platforms.

◆ visualComponent

GameObject PlatformerPro.GrapplingHookProjectile.visualComponent

The visual component of the hook that is disabled when not visible and enabled when visible.

Property Documentation

◆ IsVisible

bool PlatformerPro.GrapplingHookProjectile.IsVisible
get

Can we see the projectile?


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