C# Class UnityPlatformer.MovingPlatform

Moving Platform Tile
Inheritance: RaycastController, IUpdateEntity
Afficher le fichier Open project: llafuente/unity-platformer

Méthodes publiques

Свойство Type Description
disableDownRayCast bool
onReachWaypoint ReachWaypoint
onResume System.Action
onStop System.Action
path Line
speed float
startStopped bool

Méthodes publiques

Méthode Description
CalculatePassengerMovement ( Vector3 velocity ) : void

Calculate how much each passenger should move

DoAction ( MovingPlatformActions action ) : void

Perform an action over MovingPlatform like: Resume, stop, reverse....

IsStopped ( ) : bool

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics

LatePlatformerUpdate ( float delta ) : void

Do nothing

MovePassengers ( bool beforeMovePlatform ) : void

Move passenger

OnDisable ( ) : void

notify UpdateManager

OnEnable ( ) : void

notify UpdateManager

PlatformerUpdate ( float delta ) : void

Get passenger list, pre update, move and post update

Resume ( ) : void

Resume movement with default speed

Reverse ( ) : void

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics

Start ( ) : void

Setup initial state

Stop ( ) : void

Stop MovingPlatform

StopOn ( int waypoints ) : void

TODO

Private Methods

Méthode Description
CalculatePlatformMovement ( float delta ) : Vector3

Calculate how much the platform will move NOTE This can't be called without moving the platform

Ease ( float x ) : float

Ease movement formula TODO use UnityPlatformer.Easing even when some configuration don't make sense...

Method Details

CalculatePassengerMovement() public méthode

Calculate how much each passenger should move
public CalculatePassengerMovement ( Vector3 velocity ) : void
velocity Vector3
Résultat void

DoAction() public méthode

Perform an action over MovingPlatform like: Resume, stop, reverse....
public DoAction ( MovingPlatformActions action ) : void
action MovingPlatformActions
Résultat void

IsStopped() public méthode

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics
public IsStopped ( ) : bool
Résultat bool

LatePlatformerUpdate() public méthode

Do nothing
public LatePlatformerUpdate ( float delta ) : void
delta float
Résultat void

MovePassengers() public méthode

Move passenger
public MovePassengers ( bool beforeMovePlatform ) : void
beforeMovePlatform bool
Résultat void

OnDisable() public méthode

notify UpdateManager
public OnDisable ( ) : void
Résultat void

OnEnable() public méthode

notify UpdateManager
public OnEnable ( ) : void
Résultat void

PlatformerUpdate() public méthode

Get passenger list, pre update, move and post update
public PlatformerUpdate ( float delta ) : void
delta float
Résultat void

Resume() public méthode

Resume movement with default speed
public Resume ( ) : void
Résultat void

Reverse() public méthode

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics
public Reverse ( ) : void
Résultat void

Start() public méthode

Setup initial state
public Start ( ) : void
Résultat void

Stop() public méthode

Stop MovingPlatform
public Stop ( ) : void
Résultat void

StopOn() public méthode

TODO
public StopOn ( int waypoints ) : void
waypoints int
Résultat void

Property Details

disableDownRayCast public_oe property

downcast can move Character in unexpected manners but it's also necessary for one-way-moving-platforms... TODO kill player?
public bool disableDownRayCast
Résultat bool

onReachWaypoint public_oe property

It's called just after select next waypoint and before apply waitTime
public ReachWaypoint onReachWaypoint
Résultat ReachWaypoint

onResume public_oe property

callback call when MovingPlatform is resume
public Action,System onResume
Résultat System.Action

onStop public_oe property

callback call when MovingPlatform is stopped
public Action,System onStop
Résultat System.Action

path public_oe property

Path that MovingPlatform will follow
public Line path
Résultat Line

speed public_oe property

Speed along the path
public float speed
Résultat float

startStopped public_oe property

Initial state stop?
public bool startStopped
Résultat bool