Core GameKit
3.2.9.0
The ultimate pooling / combat / spawning / variable plugin!
|
This class is used to set up Killable, used for combat objects with attack points and hit points. Also can be used for pickups such as coins and health packs. More...
Public Member Functions | |
virtual void | BecameVisible () |
This gets called when the Killable becomes visible. More... | |
virtual void | BecameInvisible () |
This gets called when the Killable becomes invisible More... | |
virtual void | ControllerColliderHit (GameObject hit, bool calledFromOtherKillable=false) |
This gets called when the Killable has a collision from a CharacterController. Do not call this. More... | |
void | AddAttackPoints (int pointsToAdd) |
Call this method to add attack points to the Killable. More... | |
void | AddHitPoints (int pointsToAdd) |
Call this method to add hit points to the Killable. More... | |
void | FireRespawnEvents () |
Gets called internally, you should never need to call this. More... | |
void | StartDeathTimer () |
Use this method to start the death timer. Timer will start from "now". More... | |
void | StopDeathTimer () |
Use this method to stop the death timer. More... | |
void | TemporaryInvincibility (float seconds) |
Call this method to make your Killable invincible for X seconds. More... | |
virtual void | ModifyWorldVariables (WorldVariableCollection modCollection, bool isDamage, bool fireAnyway=false) |
This method is used to change World Variable values during damage or destruction. This can be overridden in a subclass to do other things. More... | |
virtual bool | DespawnPrefab () |
Override this in a subclass if you want to use a network Destroy or something like that More... | |
virtual Transform | SpawnPrefab (Transform prefabToSpawn, Vector3 spawnPos) |
Override this in a subclass if you want to use a network Instantiate or something like that More... | |
virtual Transform | SpawnDeathPrefab (Transform deathPre, Vector3 spawnPos, Quaternion spawnRotation, Transform theParent) |
Override this in a subclass if you want to use a network Instantiate or something like that More... | |
virtual bool | Despawn (TriggeredSpawner.EventType eType) |
Call this method to despawn the Killable. This is not the same as DestroyKillable. This will not spawn a death prefab and will not modify World Variables. More... | |
virtual bool | DespawnOrRespawn () |
Despawns or respawns depending on the setup option chosen. Except when Despawn Behavior is set to "Disable", in which case this game object is disabled instead. More... | |
virtual bool | DespawnThis () |
This handles just despawning the item, when it's decided that you don't want to just immediately respawn it. More... | |
void | DestroyImmediately (string scenarioName=DestroyedText) |
This method can be called to immediately destroy the Killable (death delay will be ignored) More... | |
virtual void | DestroyKillable (string scenarioName=DestroyedText, bool skipDeathDelay=false) |
Call this method when you want the Killable to die. The death prefab (if any) will be spawned and World Variable Modifiers will be executed. More... | |
virtual string | DetermineScenario (string scenarioName) |
This method you can override in a subclass to add logic to decide which Scenario to use. More... | |
virtual bool | IsInvincible () |
Determines whether this instance is invincible. More... | |
virtual bool | IsTemporarilyInvincible () |
Determines whether this instance is temporarily invincible. More... | |
virtual void | Knockback (Killable enemy) |
This will knock back (and up) this Killable based on the Knockback settings of Enemy passed in. More... | |
virtual void | TakeDamage (int damagePoints) |
Call this method to inflict X points of damage to a Killable. More... | |
virtual void | TakeDamage (int damagePoints, Killable enemy) |
Call this method to inflict X points of damage to a Killable. More... | |
Protected Member Functions | |
virtual void | Despawned () |
This method is automatically called just before the Killable is Despawned More... | |
virtual void | _OnClick () |
This method gets called when a Killable is clicked More... | |
virtual void | _OnMouseDown () |
This method gets called when a Killable has a mouse button clicked down. More... | |
virtual void | DamagePrefabFailedSpawn (Transform prefabToSpawn) |
This method will be called when a Damage Prefab fails to spawn. More... | |
virtual void | DamagePrefabSpawned (Transform spawnedDamagePrefab) |
This method will be called when a Damage Prefab spawns. More... | |
virtual void | DamagePrevented (int pointsDamage, Killable enemyHitBy) |
This method is called when damage is prevents by Invincibility More... | |
virtual void | DeathDelayStarted () |
This method gets called when the death delay starts (good to override and play a death animation). More... | |
virtual void | DeathPrefabFailedSpawn (Transform deathPre) |
This method gets called when a Death Prefab fails to spawn. More... | |
virtual void | DeathPrefabSpawned (Transform spawnedDeathPrefab) |
This method gets called when a Death Prefab spawns. More... | |
virtual void | ModifyDamageWorldVariables (List< WorldVariableModifier > mods) |
This method will be called when the Damage World Variable Modifiers are about to be modified. More... | |
virtual void | ModifyDeathWorldVariables (List< WorldVariableModifier > mods) |
This method will be called when the Death World Variable Modifiers are about to be modified. More... | |
virtual bool | ShouldDieFromNonDamageHit (Killable enemyKillable) |
This method will be used for "Any Hit" deaths if specified. You can override this to add additional criteria to a subclass. More... | |
virtual bool | ShouldFireDamageVariableModifiers () |
This will determine whether or not to use the "Damage World Variable Modifiers" that are set up whenever the Killable is damaged. More... | |
virtual bool | ShouldFireDeathVariableModifiers () |
This will determine whether or not to use the "Death World Variable Modifiers" that are set up whenever the Killable is damaged. More... | |
virtual void | SpawnedOrAwake (bool spawned=true) |
This method gets called whenever the object is spawned or starts in a Scene (from Awake event) More... | |
virtual void | SpawnerDestroyed () |
This method gets called when the game object that spawned this Killable is destroyed. More... | |
virtual void | TakingDamage (int damagePoints, Killable enemy) |
This method when damage is valid and is about to be inflicted (no invincibility). More... | |
Properties | |
List< Killable > | ChildKillables [get] |
Returns a list of all Killables that are a child of this one. More... | |
int | CurrentHitPoints [get, set] |
The current hit points. More... | |
Transform | CurrentVanishPrefab [get] |
This returns the Vanish prefab for this Killable (spawned when it despawns if not "killed"). More... | |
Transform | CurrentDealDamagePrefab [get] |
This returns the Deal Damage prefab for this Killable (spawned on things it damages only). More... | |
Transform | CurrentInvinceHitPrefab [get] |
This returns the Invince Hit prefab for this Killable (spawned when it is hit while Invincible). More... | |
bool | GameIsOverForKillable [get] |
This property will return true if the Game Over Behavior setting makes this Killable disabled. More... | |
bool | IsDead [get] |
This will return if the Killable has died (maybe of use to other non-CGK scripts). More... | |
bool | IsGravBody [get] |
Returns whether the Killable has a gravity rigidbody (3d or 2d) More... | |
Killable | KilledBy [get] |
This property will return a reference to the Killable that dealt lethal damage to this one. More... | |
Vector3 | RespawnPosition [get, set] |
Gets or sets the respawn position. Defaults to the location last spawned. More... | |
GameObject | SpawnedFromObject [get] |
The game object this Killable was spawned from, if any. More... | |
Transform | Trans [get] |
This property returns a cached lazy-lookup of the Transform component. More... | |
int | TimesRespawned [get] |
This property returns the number of times this Killable has been respawned since it was first spawned. More... | |
This class is used to set up Killable, used for combat objects with attack points and hit points. Also can be used for pickups such as coins and health packs.
|
protectedvirtual |
This method gets called when a Killable is clicked
|
protectedvirtual |
This method gets called when a Killable has a mouse button clicked down.
void DarkTonic.CoreGameKit.Killable.AddAttackPoints | ( | int | pointsToAdd | ) |
Call this method to add attack points to the Killable.
pointsToAdd | The number of attack points to add. |
void DarkTonic.CoreGameKit.Killable.AddHitPoints | ( | int | pointsToAdd | ) |
Call this method to add hit points to the Killable.
pointsToAdd | The number of hit points to add to "current hit points". |
|
virtual |
This gets called when the Killable becomes invisible
|
virtual |
This gets called when the Killable becomes visible.
|
virtual |
This gets called when the Killable has a collision from a CharacterController. Do not call this.
hit | The game object being hit. |
calledFromOtherKillable | The object calling this method |
|
protectedvirtual |
This method will be called when a Damage Prefab fails to spawn.
prefabToSpawn | The prefab that failed spawn. |
|
protectedvirtual |
This method will be called when a Damage Prefab spawns.
spawnedDamagePrefab | The prefab that spawned. |
|
protectedvirtual |
This method is called when damage is prevents by Invincibility
pointsDamage | The number of points prevented. |
enemyHitBy | The enemy that tried to inflict damage. |
|
protectedvirtual |
This method gets called when the death delay starts (good to override and play a death animation).
|
protectedvirtual |
This method gets called when a Death Prefab fails to spawn.
deathPre | The Death Prefab that failed to spawn. |
|
protectedvirtual |
This method gets called when a Death Prefab spawns.
spawnedDeathPrefab | The spawned Death Prefab. |
|
virtual |
Call this method to despawn the Killable. This is not the same as DestroyKillable. This will not spawn a death prefab and will not modify World Variables.
eType | The event type. |
|
protectedvirtual |
This method is automatically called just before the Killable is Despawned
|
virtual |
Despawns or respawns depending on the setup option chosen. Except when Despawn Behavior is set to "Disable", in which case this game object is disabled instead.
|
virtual |
Override this in a subclass if you want to use a network Destroy or something like that
|
virtual |
This handles just despawning the item, when it's decided that you don't want to just immediately respawn it.
void DarkTonic.CoreGameKit.Killable.DestroyImmediately | ( | string | scenarioName = DestroyedText | ) |
This method can be called to immediately destroy the Killable (death delay will be ignored)
scenarioName |
|
virtual |
Call this method when you want the Killable to die. The death prefab (if any) will be spawned and World Variable Modifiers will be executed.
scenarioName | (optional) pass the name of an alternate scenario if you wish to use a different set of World Variable Modifiers from that scenario. |
skipDeathDelay | You can pass true to skip the death delay and "destroy now" |
|
virtual |
This method you can override in a subclass to add logic to decide which Scenario to use.
scenarioName | The default scenario is passed here by default (Destroyed). |
void DarkTonic.CoreGameKit.Killable.FireRespawnEvents | ( | ) |
Gets called internally, you should never need to call this.
|
virtual |
Determines whether this instance is invincible.
true
if this instance is invincible; otherwise, false
.
|
virtual |
Determines whether this instance is temporarily invincible.
true
if this instance is temporarily invincible; otherwise, false
.
|
virtual |
|
protectedvirtual |
This method will be called when the Damage World Variable Modifiers are about to be modified.
mods | The World Variable Modifier collection |
|
protectedvirtual |
This method will be called when the Death World Variable Modifiers are about to be modified.
mods | The World Variable Modifier collection |
|
virtual |
This method is used to change World Variable values during damage or destruction. This can be overridden in a subclass to do other things.
modCollection | The collection of World Variable modifications. |
isDamage | True if from damage, false otherwise. |
fireAnyway | Optional switch to ignore result of "ShouldFire" methods |
|
protectedvirtual |
This method will be used for "Any Hit" deaths if specified. You can override this to add additional criteria to a subclass.
enemyKillable |
|
protectedvirtual |
This will determine whether or not to use the "Damage World Variable Modifiers" that are set up whenever the Killable is damaged.
|
protectedvirtual |
This will determine whether or not to use the "Death World Variable Modifiers" that are set up whenever the Killable is damaged.
|
virtual |
Override this in a subclass if you want to use a network Instantiate or something like that
deathPre | The death prefab. |
spawnPos | The position to spawn it in. |
spawnRotation | The rotation to spawn it in. |
theParent | The object to parent the spawned death prefab to. |
|
protectedvirtual |
This method gets called whenever the object is spawned or starts in a Scene (from Awake event)
spawned | True if spawned, false if in the Scene at beginning. |
|
protectedvirtual |
This method gets called when the game object that spawned this Killable is destroyed.
|
virtual |
Override this in a subclass if you want to use a network Instantiate or something like that
prefabToSpawn | The prefab to spawn. |
spawnPos | The position to spawn in. |
void DarkTonic.CoreGameKit.Killable.StartDeathTimer | ( | ) |
Use this method to start the death timer. Timer will start from "now".
void DarkTonic.CoreGameKit.Killable.StopDeathTimer | ( | ) |
Use this method to stop the death timer.
|
virtual |
Call this method to inflict X points of damage to a Killable.
damagePoints | The number of points of damage to inflict. |
|
virtual |
|
protectedvirtual |
This method when damage is valid and is about to be inflicted (no invincibility).
damagePoints | Number of damage points to take. |
enemy | The enemy that dealt the damage. |
void DarkTonic.CoreGameKit.Killable.TemporaryInvincibility | ( | float | seconds | ) |
|
get |
Returns a list of all Killables that are a child of this one.
|
get |
This returns the Deal Damage prefab for this Killable (spawned on things it damages only).
|
getset |
The current hit points.
|
get |
This returns the Invince Hit prefab for this Killable (spawned when it is hit while Invincible).
|
get |
This returns the Vanish prefab for this Killable (spawned when it despawns if not "killed").
|
get |
This property will return true if the Game Over Behavior setting makes this Killable disabled.
|
get |
This will return if the Killable has died (maybe of use to other non-CGK scripts).
|
get |
Returns whether the Killable has a gravity rigidbody (3d or 2d)
|
get |
This property will return a reference to the Killable that dealt lethal damage to this one.
|
getset |
Gets or sets the respawn position. Defaults to the location last spawned.
The respawn position.
|
get |
The game object this Killable was spawned from, if any.
|
get |
This property returns the number of times this Killable has been respawned since it was first spawned.
|
get |
This property returns a cached lazy-lookup of the Transform component.