diff options
| author | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 08:59:52 +0200 | 
|---|---|---|
| committer | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 08:59:52 +0200 | 
| commit | 8380ee8819530d796c78e8add135f350e0f7a283 (patch) | |
| tree | 1d35185c060cec2a1cf7040b4173d8fd47c43e76 | |
| parent | 397abd83dc791d0d8cbbd20d918164c0c37143da (diff) | |
death scene redirect
| -rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 4c377a5..9b1971a 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -1,6 +1,7 @@  using UnityEngine;  using System.Collections;  using System.Collections.Generic; +using UnityEngine.SceneManagement;  public class DragonMovement : MonoBehaviour  { @@ -280,6 +281,13 @@ public class DragonMovement : MonoBehaviour  		Destroy(t.gameObject);  	} +	private IEnumerator eventuallyStartOver() +	{ +		for(int i=0; i<400; i++) +			yield return new WaitForSeconds(0.01f); +		SceneManager.LoadScene("Titlescreen"); +	} +	  	private void getHurt()  	{  		if(hurtCooldown <= 0) @@ -292,6 +300,7 @@ public class DragonMovement : MonoBehaviour  					Transform t = ((GameObject)Instantiate(hurtPrefab, transform.position + swarm.collapseCenter, Quaternion.identity)).transform;  					StartCoroutine(makeGoAway(t, 6));  				} +				StartCoroutine(eventuallyStartOver());  				turnVisible(false);  				swarm.activate(false);  			} |