Beispiel #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player") && bossDamageable.Health > 0)
     {
         BossUI.SetActive(true);
     }
 }
Beispiel #2
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         BossUI.SetActive(false);
     }
 }
Beispiel #3
0
    public static void Update(MenuState newState)
    {
        state = newState;
        switch (state)
        {
        case MenuState.MainMenu:
            MainUI.SetActive(false);
            BossUI.SetActive(false);
            DeathUI.SetActive(false);
            PauseMenu.SetActive(false);
            TitleScreen.SetActive(true);
            break;

        case MenuState.Paused:
            PauseMenu.SetActive(true);
            break;

        case MenuState.Dead:
            MainUI.SetActive(false);
            BossUI.SetActive(false);
            PauseMenu.SetActive(false);
            TitleScreen.SetActive(false);
            DeathUI.SetActive(true);
            break;

        case MenuState.Playing:
            PauseMenu.SetActive(false);
            TitleScreen.SetActive(false);
            DeathUI.SetActive(false);
            MainUI.SetActive(true);
            break;
        }
    }
Beispiel #4
0
 private void OnTriggerStay(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         if (bossDamageable.Health > 0)
         {
             BossUI.UpdateHealth((float)bossDamageable.Health / bossDamageable.MaxHealth);
         }
         else
         {
             BossUI.SetActive(false);
         }
     }
 }