Add this script to a platform and it'll fall down when walked upon by a playable character Add an AutoRespawn component to your platform and it'll get reset when your character dies
More...
Add this script to a platform and it'll fall down when walked upon by a playable character Add an AutoRespawn component to your platform and it'll get reset when your character dies
◆ FallingPlatformStates
the possible states for the falling platform
Enumerator |
---|
Idle | |
Shaking | |
Falling | |
ColliderOff | |
◆ DisableFallingPlatform()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.DisableFallingPlatform |
( |
| ) |
|
|
protectedvirtual |
Disables the falling platform. We're not destroying it, so we can revive it on respawn
◆ FixedUpdate()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
This is called every frame.
◆ Initialization()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs components and saves initial position and timer
◆ OnRevive()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.OnRevive |
( |
| ) |
|
|
protectedvirtual |
On Revive, we restore this platform's state
◆ OnTriggerExit2D()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.OnTriggerExit2D |
( |
Collider2D |
collider | ) |
|
|
protectedvirtual |
Triggered when a TopDownController exits the platform
- Parameters
-
controller | The TopDown controller that collides with the platform. |
◆ OnTriggerStay2D()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.OnTriggerStay2D |
( |
Collider2D |
collider | ) |
|
|
virtual |
Triggered when a TopDownController touches the platform
- Parameters
-
controller | The TopDown controller that collides with the platform. |
◆ Start()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.Start |
( |
| ) |
|
|
protectedvirtual |
◆ UpdateAnimator()
virtual void MoreMountains.TopDownEngine.FallingPlatform2D.UpdateAnimator |
( |
| ) |
|
|
protectedvirtual |
Updates the block's animator.
◆ _animator
Animator MoreMountains.TopDownEngine.FallingPlatform2D._animator |
|
protected |
◆ _bounds
Bounds MoreMountains.TopDownEngine.FallingPlatform2D._bounds |
|
protected |
◆ _collider
Collider2D MoreMountains.TopDownEngine.FallingPlatform2D._collider |
|
protected |
◆ _contact
bool MoreMountains.TopDownEngine.FallingPlatform2D._contact = false |
|
protected |
◆ _fallStartedAt
float MoreMountains.TopDownEngine.FallingPlatform2D._fallStartedAt |
|
protected |
◆ _initialPosition
Vector3 MoreMountains.TopDownEngine.FallingPlatform2D._initialPosition |
|
protected |
◆ _newPosition
Vector2 MoreMountains.TopDownEngine.FallingPlatform2D._newPosition |
|
protected |
◆ _timeLeftBeforeFall
float MoreMountains.TopDownEngine.FallingPlatform2D._timeLeftBeforeFall |
|
protected |
◆ DelayBetweenFallAndColliderOff
float MoreMountains.TopDownEngine.FallingPlatform2D.DelayBetweenFallAndColliderOff = 0.5f |
the time (in seconds) before the collider turns itself off once the fall has started
◆ InevitableFall
bool MoreMountains.TopDownEngine.FallingPlatform2D.InevitableFall = false |
if this is true, the platform will fall inevitably once touched
◆ State
the current state of the falling platform
◆ TimeBeforeFall
float MoreMountains.TopDownEngine.FallingPlatform2D.TimeBeforeFall = 2f |
the time (in seconds) before the fall of the platform
The documentation for this class was generated from the following file: