aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2019-04-28 09:30:44 +0200
committermarcinzelent <zelent.marcin@gmail.com>2019-04-28 09:30:44 +0200
commit75c104ad73cfcadebf2bcc4c012e18135666f535 (patch)
tree9c3ec783fe3c19764995194301eb60b4f915d838
parentbbd0b44cbbacae2eb2798ff9ffd087b6eee5352c (diff)
parent23b059b3c7f3d17e94dea436d0d7bcf1d81dede1 (diff)
Merge branch 'master' of https://github.com/marcinzelent/ngj2019
-rw-r--r--nGJ2019/Assets/Scripts/DragonMovement.cs9
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);
}