using UnityEngine;
using System.Collections;

public class ShipManager : MonoBehaviour {

	public Ship ship;



	public void startOnDeath()
	{
		StartCoroutine(OnDeath());
	}

	public IEnumerator OnDeath()
	{
		Debug.Log("Ship is Dead");
		ship.health.setHealth(1);
		ship.gameObject.SetActive(false);
		if(ship.health.getLives()==0)
		{
			onGameOver();
			yield return 0;
		}
		yield return new WaitForSeconds(2.0f);
		//clear powerups
		ship.gameObject.SetActive(true);
	}

	void onGameOver()
	{
		//Show Game Over Screen
	}
}
