C# Class UnityPlatformer.Rope

Rope tile
Inheritance: UnityEngine.MonoBehaviour, IUpdateEntity
Mostrar archivo Open project: llafuente/unity-platformer

Public Properties

Property Type Description
angleLimits float
easing EasingType
onBreakRope RopeCallback
onSideReached RopeCallback
passengers UnityEngine.LayerMask
ropeMass float
sectionPrefab UnityEngine.GameObject
segmentLength float
segments int
stop bool
usedFixedPosition bool

Public Methods

Method Description
BreakRope ( ) : void

Break the rope and stop movement TODO break do not destroy sections

GetSectionAbove ( GameObject section ) : GameObject

Gets the rope section above the provided one or null if none.

GetSectionBelow ( GameObject section ) : GameObject

Gets the rope section below the provided one or null if none.

LatePlatformerUpdate ( float delta ) : void

Do nothing, use PlatformerUpdate instead

OnDisable ( ) : void

notify UpdateManager

OnEnable ( ) : void

notify UpdateManager

OnValidate ( ) : void

Update the rope on each editor change...

PlatformerUpdate ( float delta ) : void

Rope motion!

SpeedToSectionOffset ( float speed ) : float

Conversion factor

Start ( ) : void
UpdateRotation ( ) : void

Update rope rotation, this is called PlatformerUpdate if you need to called it outside, remember that time must be updated before

Private Methods

Method Description
CreateAnchor ( ) : GameObject

Create Rope anchor

CreateSection ( int i, Rigidbody2D connectedBody ) : GameObject

Create and configure RopeSection

OnDrawGizmos ( ) : void

Method Details

BreakRope() public method

Break the rope and stop movement TODO break do not destroy sections
public BreakRope ( ) : void
return void

GetSectionAbove() public method

Gets the rope section above the provided one or null if none.
public GetSectionAbove ( GameObject section ) : GameObject
section UnityEngine.GameObject
return UnityEngine.GameObject

GetSectionBelow() public method

Gets the rope section below the provided one or null if none.
public GetSectionBelow ( GameObject section ) : GameObject
section UnityEngine.GameObject
return UnityEngine.GameObject

LatePlatformerUpdate() public method

Do nothing, use PlatformerUpdate instead
public LatePlatformerUpdate ( float delta ) : void
delta float
return void

OnDisable() public method

notify UpdateManager
public OnDisable ( ) : void
return void

OnEnable() public method

notify UpdateManager
public OnEnable ( ) : void
return void

OnValidate() public method

Update the rope on each editor change...
public OnValidate ( ) : void
return void

PlatformerUpdate() public method

Rope motion!
public PlatformerUpdate ( float delta ) : void
delta float
return void

SpeedToSectionOffset() public method

Conversion factor
public SpeedToSectionOffset ( float speed ) : float
speed float
return float

Start() public method

public Start ( ) : void
return void

UpdateRotation() public method

Update rope rotation, this is called PlatformerUpdate if you need to called it outside, remember that time must be updated before
public UpdateRotation ( ) : void
return void

Property Details

angleLimits public_oe property

Min rope angle.
public float angleLimits
return float

easing public_oe property

rope rotation easing
public EasingType easing
return EasingType

onBreakRope public_oe property

When rope is broken
public RopeCallback onBreakRope
return RopeCallback

onSideReached public_oe property

When a side is reached (before change waving)
public RopeCallback onSideReached
return RopeCallback

passengers public_oe property

Object that can be 'atachhed' to the rope This allow to create rope in background, for example.
public LayerMask,UnityEngine passengers
return UnityEngine.LayerMask

ropeMass public_oe property

The mass of each rope segment (except the last which has mass = ropeMass * 5).
public float ropeMass
return float

sectionPrefab public_oe property

The prefab to use for each rope section (i.e. put the mesh or sprite here)..
public GameObject,UnityEngine sectionPrefab
return UnityEngine.GameObject

segmentLength public_oe property

The length of the rope..
public float segmentLength
return float

segments public_oe property

The number of segments..
public int segments
return int

stop public_oe property

rope is stopped
public bool stop
return bool

usedFixedPosition public_oe property

If true only the bottom section of the rope will be grabable and will have a fixed position..
public bool usedFixedPosition
return bool