public void hit() { // JA JA JA I let's make some fire GameObject explosion = PoolManager.instance.explotionPool.GetObject(); explosion.transform.position = transform.position; explosion.SetActive(true); // Die Ship die gameObject.SetActive(false); ExplotionController explosionController = explosion.GetComponent <ExplotionController> (); explosionController.ShipExplosion(); SoundManager.instance.thrustOff(); if (playerDebris != null) { playerDebris.transform.position = transform.position; playerDebris.transform.rotation = transform.rotation; playerDebris.gameObject.SetActive(true); playerDebris.Explode(); } GameManager.instance.OnPlayerDeath(); SoundManager.instance.explode(); SoundManager.instance.thrustOff(); }
public void Destroy() { GameManager.instance.ResetEnemySpawnTime(); GameObject explosion = PoolManager.instance.explotionPool.GetObject(); explosion.transform.position = transform.position; explosion.SetActive(true); gameObject.SetActive(false); ExplotionController explosionController = explosion.GetComponent <ExplotionController> (); explosionController.ShipExplosion(); SoundManager.instance.explode(); }