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

Section of a rope. More...

Inheritance diagram for PlatformerPro.RopeSection:
PlatformerPro.RopeAnchor

Public Member Functions

virtual Vector2 GetCharacterPositionForPosition (float position)
 Gets the position in world space the character should be based on how far up the rope section they are. More...
 
virtual Vector2 GetCharacterPositionForPosition (float position, float handOffset)
 Gets the position in world space the character should be based on how far up the rope section they are. More...
 
virtual float GetCharacterRotationForPosition (float position, float handOffset)
 Gets the rotation (in eueler z degrees) for the given rope position. More...
 
virtual float GetPositionForCharacterPosition (Vector2 position)
 Gets how far up the rope section (0 at bottom, 1 at top) a character is. More...
 

Public Attributes

bool usedFixedPosition
 If true, the rope will not be climable but instead be a fixed point to which the character is attached. More...
 

Protected Member Functions

virtual void Init ()
 Init this instance. More...
 

Protected Attributes

Rope rope
 The parent rope. More...
 
BoxCollider2D myCollider
 The box collider for this rope section. More...
 

Properties

virtual Rope Rope [get]
 Gets the rope that owns this rope section. More...
 
virtual float Length [get]
 Get the rope section length. More...
 
virtual RopeSection SectionAbove [get]
 Gets the rope section above this one. More...
 
virtual RopeSection SectionBelow [get]
 Gets the rope section below this one. More...
 

Detailed Description

Section of a rope.

Member Function Documentation

◆ GetCharacterPositionForPosition() [1/2]

virtual Vector2 PlatformerPro.RopeSection.GetCharacterPositionForPosition ( float  position)
virtual

Gets the position in world space the character should be based on how far up the rope section they are.

Returns
The center for position.
Parameters
characterPositionCharacters grab position.

Reimplemented in PlatformerPro.RopeAnchor.

◆ GetCharacterPositionForPosition() [2/2]

virtual Vector2 PlatformerPro.RopeSection.GetCharacterPositionForPosition ( float  position,
float  handOffset 
)
virtual

Gets the position in world space the character should be based on how far up the rope section they are.

Returns
The center for position.
Parameters
characterPositionCharacters grab position.
characterPositionOffset from characters center and their grab (usually hand) position.

Reimplemented in PlatformerPro.RopeAnchor.

◆ GetCharacterRotationForPosition()

virtual float PlatformerPro.RopeSection.GetCharacterRotationForPosition ( float  position,
float  handOffset 
)
virtual

Gets the rotation (in eueler z degrees) for the given rope position.

Returns
The center for position.
Parameters
characterPositionCharacters grab position.
characterPositionOffset from characters center and their grab (usually hand) position.

Reimplemented in PlatformerPro.RopeAnchor.

◆ GetPositionForCharacterPosition()

virtual float PlatformerPro.RopeSection.GetPositionForCharacterPosition ( Vector2  position)
virtual

Gets how far up the rope section (0 at bottom, 1 at top) a character is.

Returns
The center for position.
Parameters
characterPositionCharacters grab position.

Reimplemented in PlatformerPro.RopeAnchor.

◆ Init()

virtual void PlatformerPro.RopeSection.Init ( )
protectedvirtual

Init this instance.

Reimplemented in PlatformerPro.RopeAnchor.

Member Data Documentation

◆ myCollider

BoxCollider2D PlatformerPro.RopeSection.myCollider
protected

The box collider for this rope section.

◆ rope

Rope PlatformerPro.RopeSection.rope
protected

The parent rope.

◆ usedFixedPosition

bool PlatformerPro.RopeSection.usedFixedPosition

If true, the rope will not be climable but instead be a fixed point to which the character is attached.

Property Documentation

◆ Length

virtual float PlatformerPro.RopeSection.Length
get

Get the rope section length.

The length.

◆ Rope

virtual Rope PlatformerPro.RopeSection.Rope
get

Gets the rope that owns this rope section.

The rope.

◆ SectionAbove

virtual RopeSection PlatformerPro.RopeSection.SectionAbove
get

Gets the rope section above this one.

◆ SectionBelow

virtual RopeSection PlatformerPro.RopeSection.SectionBelow
get

Gets the rope section below this one.


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