Corgi Engine
v9.0
|
Add this script to an object and it will automatically be reactivated and revived when the player respawns. More...
Public Member Functions | |
delegate void | OnReviveDelegate () |
virtual void | OnPlayerRespawn (CheckPoint checkpoint, Character player) |
When the player respawns, we reinstate this agent. More... | |
virtual void | Kill () |
Kills this object, turning its parts off based on the settings set in the inspector More... | |
virtual void | Revive () |
Revives this object, turning its parts back on again More... | |
Public Attributes | |
bool | RespawnOnPlayerRespawn = true |
if this is true, this object will respawn at its last position when the player revives More... | |
bool | RepositionToInitOnPlayerRespawn = false |
if this is true, this object will be repositioned at its initial position when the player revives More... | |
bool | DisableOnKill = false |
whether or not this auto respawn should disable its game object when Kill is called More... | |
bool | DisableModelOnKill = true |
whether or not this auto respawn should disable its character model when Kill is called More... | |
float | AutoRespawnDuration = 0f |
if this has a value superior to 0, this object will respawn at its last position X seconds after its death More... | |
int | AutoRespawnAmount = 3 |
the amount of times this object can auto respawn More... | |
int | AutoRespawnRemainingAmount = 3 |
the remaining amounts of respawns (readonly, controlled by the class at runtime) More... | |
bool | IgnoreCheckpointsAlwaysRespawn = true |
if this is true, the object will always respawn, whether or not it's associated to a checkpoint More... | |
List< CheckPoint > | AssociatedCheckpoints |
if the player respawns at these checkpoints, the object will be respawned More... | |
MMFeedbacks | RespawnFeedback |
the MMFeedbacks to play when the player respawns More... | |
OnReviveDelegate | OnRevive |
Protected Member Functions | |
virtual void | Start () |
On Start we grab our various components More... | |
virtual void | Update () |
On Update we check whether we should be reviving this agent More... | |
Protected Attributes | |
MonoBehaviour[] | _otherComponents |
Collider2D | _collider2D |
Renderer | _renderer |
Health | _health |
Character | _character |
bool | _reviving = false |
float | _timeOfDeath = 0f |
bool | _firstRespawn = true |
Vector3 | _initialPosition |
AIBrain | _aiBrain |
Add this script to an object and it will automatically be reactivated and revived when the player respawns.
|
virtual |
Kills this object, turning its parts off based on the settings set in the inspector
|
virtual |
When the player respawns, we reinstate this agent.
checkpoint | Checkpoint. |
player | Player. |
Implements MoreMountains.CorgiEngine.Respawnable.
delegate void MoreMountains.CorgiEngine.AutoRespawn.OnReviveDelegate | ( | ) |
|
virtual |
Revives this object, turning its parts back on again
|
protectedvirtual |
On Start we grab our various components
|
protectedvirtual |
On Update we check whether we should be reviving this agent
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
List<CheckPoint> MoreMountains.CorgiEngine.AutoRespawn.AssociatedCheckpoints |
if the player respawns at these checkpoints, the object will be respawned
int MoreMountains.CorgiEngine.AutoRespawn.AutoRespawnAmount = 3 |
the amount of times this object can auto respawn
float MoreMountains.CorgiEngine.AutoRespawn.AutoRespawnDuration = 0f |
if this has a value superior to 0, this object will respawn at its last position X seconds after its death
int MoreMountains.CorgiEngine.AutoRespawn.AutoRespawnRemainingAmount = 3 |
the remaining amounts of respawns (readonly, controlled by the class at runtime)
bool MoreMountains.CorgiEngine.AutoRespawn.DisableModelOnKill = true |
whether or not this auto respawn should disable its character model when Kill is called
bool MoreMountains.CorgiEngine.AutoRespawn.DisableOnKill = false |
whether or not this auto respawn should disable its game object when Kill is called
bool MoreMountains.CorgiEngine.AutoRespawn.IgnoreCheckpointsAlwaysRespawn = true |
if this is true, the object will always respawn, whether or not it's associated to a checkpoint
OnReviveDelegate MoreMountains.CorgiEngine.AutoRespawn.OnRevive |
bool MoreMountains.CorgiEngine.AutoRespawn.RepositionToInitOnPlayerRespawn = false |
if this is true, this object will be repositioned at its initial position when the player revives
MMFeedbacks MoreMountains.CorgiEngine.AutoRespawn.RespawnFeedback |
the MMFeedbacks to play when the player respawns
bool MoreMountains.CorgiEngine.AutoRespawn.RespawnOnPlayerRespawn = true |
if this is true, this object will respawn at its last position when the player revives