private void checkLoss() { bool isGameOver = false; LossConditions lossType = LossConditions.None; //check each loss condition, return if (exterminationHealth < exterminationDeathThreshold) { Debug.Log("extermination loss"); isGameOver = true; lossType = LossConditions.Extermination; } else if (explorationHealth < explorationDeathThreshold) { Debug.Log("exploration loss"); isGameOver = true; lossType = LossConditions.Exploration; } else if (fishingHealth < fishingDeathThreshold) { Debug.Log("Fishing loss"); isGameOver = true; lossType = LossConditions.Fishing; } if (isGameOver) { LossMessage(lossType); Time.timeScale = 0; } }
private void activateLossUI(LossConditions lossType) { Debug.Log("Loss UI updated"); for (int i = 0; i < 10; i++) { losingText.transform.GetChild(i).GetComponent <TextMeshProUGUI>().text = lossType.Value; } losingUI.SetActive(true); }
private void LossMessage(LossConditions lossType) { Debug.Log("SentLossMessage"); Messenger <LossConditions> .Broadcast(Channels.Losing.GetPath(), lossType, MessengerMode.DONT_REQUIRE_LISTENER); }