private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { BossUI.SetActive(false); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player") && bossDamageable.Health > 0) { BossUI.SetActive(true); } }
private void Awake() { if (instance == null) { instance = this; } }
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; } }
private void Start() { BUI = FindObjectOfType <BossUI>(); BUI.TurnOn(); BHB = BUI.gameObject.GetComponentInChildren <HealthBar>(); BHB.MaxHealthPoints = maxHealth; Intro(); }
private void OnTriggerStay(Collider other) { if (other.CompareTag("Player")) { if (bossDamageable.Health > 0) { BossUI.UpdateHealth((float)bossDamageable.Health / bossDamageable.MaxHealth); } else { BossUI.SetActive(false); } } }
void Awake() { instance = this; }