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
◆ DisableFallingPlatform()
virtual void MoreMountains.CorgiEngine.FallingPlatform.DisableFallingPlatform |
( |
| ) |
|
|
protectedvirtual |
Disables the falling platform. We're not destroying it, so we can revive it on respawn
◆ FixedUpdate()
virtual void MoreMountains.CorgiEngine.FallingPlatform.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
This is called every frame.
◆ Initialization()
virtual void MoreMountains.CorgiEngine.FallingPlatform.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs components and saves initial position and timer
◆ OnDisable()
virtual void MoreMountains.CorgiEngine.FallingPlatform.OnDisable |
( |
| ) |
|
|
protectedvirtual |
◆ OnEnable()
virtual void MoreMountains.CorgiEngine.FallingPlatform.OnEnable |
( |
| ) |
|
|
protectedvirtual |
When the player respawns, we reinstate this agent.
- Parameters
-
checkpoint | Checkpoint. |
player | Player. |
◆ OnRevive()
virtual void MoreMountains.CorgiEngine.FallingPlatform.OnRevive |
( |
| ) |
|
|
protectedvirtual |
◆ OnTriggerExit2D()
virtual void MoreMountains.CorgiEngine.FallingPlatform.OnTriggerExit2D |
( |
Collider2D |
collider | ) |
|
|
protectedvirtual |
Triggered when a CorgiController exits the platform
- Parameters
-
controller | The corgi controller that collides with the platform. |
◆ OnTriggerStay2D()
virtual void MoreMountains.CorgiEngine.FallingPlatform.OnTriggerStay2D |
( |
Collider2D |
collider | ) |
|
|
virtual |
Triggered when a CorgiController touches the platform
- Parameters
-
controller | The corgi controller that collides with the platform. |
◆ Start()
virtual void MoreMountains.CorgiEngine.FallingPlatform.Start |
( |
| ) |
|
|
protectedvirtual |
◆ UpdateAnimator()
virtual void MoreMountains.CorgiEngine.FallingPlatform.UpdateAnimator |
( |
| ) |
|
|
protectedvirtual |
Updates the block's animator.
◆ _animator
Animator MoreMountains.CorgiEngine.FallingPlatform._animator |
|
protected |
◆ _autoRespawn
AutoRespawn MoreMountains.CorgiEngine.FallingPlatform._autoRespawn |
|
protected |
◆ _bounds
Bounds MoreMountains.CorgiEngine.FallingPlatform._bounds |
|
protected |
◆ _collider2D
Collider2D MoreMountains.CorgiEngine.FallingPlatform._collider2D |
|
protected |
◆ _initialPosition
Vector3 MoreMountains.CorgiEngine.FallingPlatform._initialPosition |
|
protected |
◆ _newPosition
Vector2 MoreMountains.CorgiEngine.FallingPlatform._newPosition |
|
protected |
◆ _platformTopY
float MoreMountains.CorgiEngine.FallingPlatform._platformTopY |
|
protected |
◆ _shaking
bool MoreMountains.CorgiEngine.FallingPlatform._shaking = false |
|
protected |
◆ _timer
float MoreMountains.CorgiEngine.FallingPlatform._timer |
|
protected |
◆ FallSpeed
float MoreMountains.CorgiEngine.FallingPlatform.FallSpeed = 2f |
the speed at which the platforms falls
◆ RequiresCharacterAbove
bool MoreMountains.CorgiEngine.FallingPlatform.RequiresCharacterAbove = true |
if this is true, the platform will only fall if the colliding character is above the platform
◆ Shaking
bool MoreMountains.CorgiEngine.FallingPlatform.Shaking => _shaking |
whether this platform is currently shaking or not
◆ TimeBeforeFall
float MoreMountains.CorgiEngine.FallingPlatform.TimeBeforeFall = 2f |
the time (in seconds) before the fall of the platform
◆ Tolerance
float MoreMountains.CorgiEngine.FallingPlatform.Tolerance = 0.1f |
the tolerance to apply when comparing the relative positions of the falling platform and
The documentation for this class was generated from the following file: