Corgi Engine
v9.0
|
Add this class to a block and it'll behave like these Super Mario blocks that spawn something when hit from below More...
Public Member Functions | |
virtual void | Start () |
Initialization More... | |
virtual void | OnTriggerEnter2D (Collider2D collider) |
Triggered when a CorgiController touches the platform More... | |
virtual void | OnTriggerExit2D (Collider2D collider) |
Triggered when a CorgiController exits the platform More... | |
virtual void | OnPlayerRespawn (CheckPoint checkpoint, Character player) |
Triggered when the player respawns, resets the block if needed More... | |
Public Attributes | |
GameObject | SpawnedObject |
the object this bonus block should spawn More... | |
int | NumberOfAllowedHits =3 |
the number of hits the block can take More... | |
bool | ResetOnDeath = false |
should this object get reset when the main character dies? More... | |
float | SpawnSpeed = 0.2f |
the speed at which the block spawns its content More... | |
Vector3 | SpawnDestination |
the offset position for the block's content spawn More... | |
bool | AnimateSpawn = true |
if true, should animate the object's spawn More... | |
AnimationCurve | MovementCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1f, 1)) |
the block's movement Animation Curve More... | |
Protected Member Functions | |
virtual void | Initialization () |
Initialization More... | |
virtual void | Update () |
This is called every frame. More... | |
virtual void | UpdateAnimator () |
Updates the animator. More... | |
Protected Attributes | |
Animator | _animator |
bool | _hit =false |
Vector2 | _newPosition |
int | _numberOfHitsLeft |
BoxCollider2D | _boxCollider2D |
Add this class to a block and it'll behave like these Super Mario blocks that spawn something when hit from below
|
protectedvirtual |
Initialization
|
virtual |
Triggered when the player respawns, resets the block if needed
checkpoint | Checkpoint. |
player | Player. |
Implements MoreMountains.CorgiEngine.Respawnable.
|
virtual |
Triggered when a CorgiController touches the platform
controller | The corgi controller that collides with the platform. |
|
virtual |
Triggered when a CorgiController exits the platform
controller | The corgi controller that collides with the platform. |
|
virtual |
Initialization
|
protectedvirtual |
This is called every frame.
|
protectedvirtual |
Updates the animator.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.CorgiEngine.BonusBlock.AnimateSpawn = true |
if true, should animate the object's spawn
AnimationCurve MoreMountains.CorgiEngine.BonusBlock.MovementCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1f, 1)) |
the block's movement Animation Curve
int MoreMountains.CorgiEngine.BonusBlock.NumberOfAllowedHits =3 |
the number of hits the block can take
bool MoreMountains.CorgiEngine.BonusBlock.ResetOnDeath = false |
should this object get reset when the main character dies?
Vector3 MoreMountains.CorgiEngine.BonusBlock.SpawnDestination |
the offset position for the block's content spawn
GameObject MoreMountains.CorgiEngine.BonusBlock.SpawnedObject |
the object this bonus block should spawn
float MoreMountains.CorgiEngine.BonusBlock.SpawnSpeed = 0.2f |
the speed at which the block spawns its content