diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2019-04-28 09:30:44 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2019-04-28 09:30:44 +0200 |
commit | 75c104ad73cfcadebf2bcc4c012e18135666f535 (patch) | |
tree | 9c3ec783fe3c19764995194301eb60b4f915d838 /nGJ2019/Assets/Scripts/DragonMovement.cs | |
parent | bbd0b44cbbacae2eb2798ff9ffd087b6eee5352c (diff) | |
parent | 23b059b3c7f3d17e94dea436d0d7bcf1d81dede1 (diff) |
Merge branch 'master' of https://github.com/marcinzelent/ngj2019
Diffstat (limited to 'nGJ2019/Assets/Scripts/DragonMovement.cs')
-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); } |