/* * Remember to move the turret's transform to 0. * */ private void Awake() { spellStats = GetComponent <SpellStats>(); collider = GetComponent <CircleCollider2D>(); collider.radius = spellStats.GetRange(); collider.enabled = false; currentShotNumber = 0; turretAutofireCurrentCooldown = 0.5f; }
//private bool enableHeal = false; private void Awake() { spellStats = GetComponent <SpellStats>(); collider2D = GetComponent <CircleCollider2D>(); totalHealingAmount = spellStats.GetSpellDamage(); healingTurretRange = spellStats.GetRange(); GetComponent <CircleCollider2D>().radius = healingTurretRange; amountPerHeal = totalHealingAmount / (effectTime / timeBetweenHeals); }
/* * Eventually make this a coroutine that waits for a response from the turret that it has finished it's death. * */ public void BlowTurretsUpForDamage(Queue <GameObject> turrets) { while (turrets.Count != 0) { GameObject turret = turrets.Dequeue(); Vector3 turretlocationRelativeToPlayer = turret.transform.localPosition; GameObject explosion = Instantiate(turretExplosions, turretlocationRelativeToPlayer, Quaternion.identity, transform); explosion.GetComponent <TurretExplosionDamageSender>().BlowUpTurrets(spellStats.GetSpellDamage(), spellStats.GetRange()); Destroy(turret); } }
private void Awake() { spellSpawnLocation = transform.position; spellStats = GetComponent <SpellStats>(); despawnRange = spellStats.GetRange(); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { return; } if (other.tag == "Enemy") { gameObject.GetComponent <SpriteRenderer>().enabled = false; Instantiate(enemyExplosion, other.transform.position, other.transform.rotation); GameObject mineExplosion = Instantiate(explosion, transform.position, transform.rotation, transform); mineExplosion.GetComponent <TurretExplosionDamageSender>().BlowUpTurrets(spellStats.GetSpellDamage(), spellStats.GetRange()); } }