C# Класс UnityPlatformer.MovingPlatform

Moving Platform Tile
Наследование: RaycastController, IUpdateEntity
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
disableDownRayCast bool
onReachWaypoint ReachWaypoint
onResume System.Action
onStop System.Action
path Line
speed float
startStopped bool

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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...

Описание методов

CalculatePassengerMovement() публичный Метод

Calculate how much each passenger should move
public CalculatePassengerMovement ( Vector3 velocity ) : void
velocity Vector3
Результат void

DoAction() публичный Метод

Perform an action over MovingPlatform like: Resume, stop, reverse....
public DoAction ( MovingPlatformActions action ) : void
action MovingPlatformActions
Результат void

IsStopped() публичный Метод

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics
public IsStopped ( ) : bool
Результат bool

LatePlatformerUpdate() публичный Метод

Do nothing
public LatePlatformerUpdate ( float delta ) : void
delta float
Результат void

MovePassengers() публичный Метод

Move passenger
public MovePassengers ( bool beforeMovePlatform ) : void
beforeMovePlatform bool
Результат void

OnDisable() публичный Метод

notify UpdateManager
public OnDisable ( ) : void
Результат void

OnEnable() публичный Метод

notify UpdateManager
public OnEnable ( ) : void
Результат void

PlatformerUpdate() публичный Метод

Get passenger list, pre update, move and post update
public PlatformerUpdate ( float delta ) : void
delta float
Результат void

Resume() публичный Метод

Resume movement with default speed
public Resume ( ) : void
Результат void

Reverse() публичный Метод

Reverse waypoints, current waypoint and percentBetweenWaypoints This is used when reach the end, so we don't need handle both logics
public Reverse ( ) : void
Результат void

Start() публичный Метод

Setup initial state
public Start ( ) : void
Результат void

Stop() публичный Метод

Stop MovingPlatform
public Stop ( ) : void
Результат void

StopOn() публичный Метод

TODO
public StopOn ( int waypoints ) : void
waypoints int
Результат void

Описание свойств

disableDownRayCast публичное свойство

downcast can move Character in unexpected manners but it's also necessary for one-way-moving-platforms... TODO kill player?
public bool disableDownRayCast
Результат bool

onReachWaypoint публичное свойство

It's called just after select next waypoint and before apply waitTime
public ReachWaypoint onReachWaypoint
Результат ReachWaypoint

onResume публичное свойство

callback call when MovingPlatform is resume
public Action,System onResume
Результат System.Action

onStop публичное свойство

callback call when MovingPlatform is stopped
public Action,System onStop
Результат System.Action

path публичное свойство

Path that MovingPlatform will follow
public Line path
Результат Line

speed публичное свойство

Speed along the path
public float speed
Результат float

startStopped публичное свойство

Initial state stop?
public bool startStopped
Результат bool