From 8380ee8819530d796c78e8add135f350e0f7a283 Mon Sep 17 00:00:00 2001 From: Mikkel Bybjerg Date: Sun, 28 Apr 2019 08:59:52 +0200 Subject: death scene redirect --- nGJ2019/Assets/Scripts/DragonMovement.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } -- cgit v1.2.3