diff --git a/MuseumGame/Assets/Scenes/DemoLevels/BossRoom.unity b/MuseumGame/Assets/Scenes/DemoLevels/BossRoom.unity index 40900b7..747be08 100644 --- a/MuseumGame/Assets/Scenes/DemoLevels/BossRoom.unity +++ b/MuseumGame/Assets/Scenes/DemoLevels/BossRoom.unity @@ -1728,6 +1728,9 @@ MonoBehaviour: timeBetween: 4 enemyHealth: 100 damageTaken: 10 + doors: + - {fileID: 1787950110} + - {fileID: 1115280552} --- !u!95 &453535362 Animator: serializedVersion: 3 diff --git a/MuseumGame/Assets/Scripts/DaisyBoss.cs b/MuseumGame/Assets/Scripts/DaisyBoss.cs index 60ce6cc..f97df12 100644 --- a/MuseumGame/Assets/Scripts/DaisyBoss.cs +++ b/MuseumGame/Assets/Scripts/DaisyBoss.cs @@ -13,6 +13,7 @@ public class DaisyBoss : MonoBehaviour private EnemyHealthBar ehb; public int enemyHealth; public int damageTaken; + public GameObject[] doors; // Start is called before the first frame update void Start() @@ -22,6 +23,10 @@ public class DaisyBoss : MonoBehaviour enemyHealthBar = GameManager.Instance.GetEnemyHealthBar(); ehb = enemyHealthBar.GetComponent(); enemyHealthBar.gameObject.SetActive(true); + foreach (GameObject i in doors) { + i.GetComponent().isTrigger = false; + i.GetComponent().enabled = false; + } } @@ -37,6 +42,11 @@ public class DaisyBoss : MonoBehaviour ehb.SetHealth(enemyHealth); if (enemyHealth <=0) { enemyHealthBar.SetActive(false); + foreach (GameObject i in doors) + { + i.GetComponent().isTrigger = true; + i.GetComponent().enabled = true; + } Destroy(gameObject); } diff --git a/MuseumGame/Assets/Scripts/LoadLevel.cs b/MuseumGame/Assets/Scripts/LoadLevel.cs index fb13c72..6653100 100644 --- a/MuseumGame/Assets/Scripts/LoadLevel.cs +++ b/MuseumGame/Assets/Scripts/LoadLevel.cs @@ -20,7 +20,7 @@ public class LoadLevel : MonoBehaviour private void OnTriggerEnter2D(Collider2D collision) { - if (collision.CompareTag("Player")) + if (collision.CompareTag("Player") && enabled) { GameManager.Instance.LoadLevel(LevelName, whereTo); }