void AllEnemiesDead() { if (enemy1.isAlive == false && enemy2.isAlive == false && enemy3.isAlive == false) { openDoor.OpenDoor(); } }
private void BossHealthCheck() { if (spawnState != SpawnState.Attacking) { return; } if (bossHealth.CurrentHealth > 0) { return; } OpenArenaDoors(); spawnState = SpawnState.Dead; // sets to dead BossManager.instance.SetStatus(bossName, BossStatus.Dead); BossManager.instance.SetCombatState(false); CameraManager.instance.RemoveBoss(); // Removes the boss from camera BossHealthUI.instance.HideHealthBar(); AudioManager.instance.UpdateMusicTrack(); if (door != null) { door.OpenDoor(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.GetComponent <PlayerCombat>() && !_isActivated) { _isActivated = true; _door.OpenDoor(); AudioManager.Instance.PlaySFX(SoundsFx.GetKey); if (GetComponentInChildren <Light2D>()) { GetComponentInChildren <Light2D>().enabled = false; } GetComponent <CapsuleCollider2D>().enabled = false; GetComponent <SpriteRenderer>().enabled = false; } }
// Update is called once per frame void Update() { if (ItemHandler.justPickedKey) { hasKey = true; GUIManager.SetDisplayText("Got Key!", 2); } if (ItemHandler.justPickedSword) { hasSword = true; GUIManager.SetDisplayText("Got Sword!", 2); } bool nearDoor = LockedDoor.playerEntered; if (nearDoor) { if (hasKey && hasSword) { LockedDoor.OpenDoor(); } else if (hasKey) { GUIManager.SetDisplayText("You still need a sword!", 3); } else if (hasSword) { GUIManager.SetDisplayText("You still need a key!", 3); } else { GUIManager.SetDisplayText("The door is locked! Find a key!", 3); } } }
public void OpenGate() { openDoor.OpenDoor(); }