/// <summary> /// Kills the missile and spawn an explosion /// </summary> public void KillMissile() { Vector3 pos = transform.position; pos.y += ExplosionYOffset; // Spawn the explosion (also kills this game object) explodable.SpawnExplosion(pos); }
// Perform death cleanup void DoDie() { if (isDead) { return; } isDead = true; transform.SetParent(null); explodable.SpawnExplosion(transform.position, 0.075f); }