platformer
|
Track tile: Modify characters velocity, could be used for wind, moving floors More...
Public Member Functions | |
delegate void | CharacterEvent (Character c) |
Delegate type More... | |
override void | CharacterEnter (Character character) |
Character enter: set track property and call onEnter More... | |
override void | CharacterExit (Character character) |
Character leaves: remove track property and call onExit More... | |
override void | CharacterStay (Character character) |
This is called when Character is in, two things can happen I'm alredy in this track: OK I'm not in this track: Enter if no other track is used More... | |
![]() | |
override void | Start () |
Force BoxCollider2D to be trigger using: Utils.KinematicTrigger and initialize character list More... | |
virtual Vector3 | GetCenter () |
Get real-world-coordinates center More... | |
virtual void | OnDestroy () |
exit all player More... | |
virtual void | OnTriggerEnter2D (Collider2D o) |
if Hitbox with EnterAreas enter -> CharacterEnter More... | |
virtual void | OnTriggerExit2D (Collider2D o) |
if Hitbox with EnterAreas leave -> CharacterExit More... | |
virtual void | OnTriggerStay2D (Collider2D o) |
if Hitbox with EnterAreas leave -> CharacterExit More... | |
Public Attributes | |
Vector3 | velocity = Vector3.zero |
Velocity that will be added to characters inside track More... | |
float | accelerationTime = 0.5f |
Time to reach max velocity More... | |
CharacterStatesCheck | characterState |
Combo to check character state More... | |
CharacterEvent | onEnter |
Called when a new Character enter the Track area More... | |
CharacterEvent | onExit |
Called when a new Character leave the Track area More... | |
![]() | |
BoxCollider2D | body |
cached BoxCollider2D component More... | |
Character [] | characters |
List of character in the Tile More... | |
int | charCount |
How many character are in the Tile More... | |
![]() | |
bool | debug = false |
Display collider as flat color More... | |
Protected Member Functions | |
void | Accelerate (Character character, float delta) |
Calculate character velocity More... | |
Track tile: Modify characters velocity, could be used for wind, moving floors
NOTE: The velocity applied is applied after terminal velocity so it's an extra.
NOTE: Tracks should not overlap. Character will enter the first one it hit then when leave the track will enter the other, only one track at a time
|
inlineprotected |
Calculate character velocity
|
inlinevirtual |
Character enter: set track property and call onEnter
Reimplemented from UnityPlatformer.BoxTileTrigger.
delegate void UnityPlatformer.Track.CharacterEvent | ( | Character | c | ) |
Delegate type
|
inlinevirtual |
Character leaves: remove track property and call onExit
Reimplemented from UnityPlatformer.BoxTileTrigger.
|
inlinevirtual |
This is called when Character is in, two things can happen I'm alredy in this track: OK I'm not in this track: Enter if no other track is used
Reimplemented from UnityPlatformer.BoxTileTrigger.
float UnityPlatformer.Track.accelerationTime = 0.5f |
Time to reach max velocity
CharacterStatesCheck UnityPlatformer.Track.characterState |
Combo to check character state
CharacterEvent UnityPlatformer.Track.onEnter |
CharacterEvent UnityPlatformer.Track.onExit |
Vector3 UnityPlatformer.Track.velocity = Vector3.zero |
Velocity that will be added to characters inside track