void OnPlayerStateChange(Enums.Players player, Enums.PlayerState targetState) { foreach (Enums.PlayerState state in playerUIs[player].panels.Keys) { playerUIs[player].panels[state].SetActive(false); } playerUIs[player].panels[targetState].SetActive(true); if (targetState != Enums.PlayerState.Disaster) { DisasterUIInfo info = disasterUIInfos.Where(d => d.playerName == player).ToList()[0]; info.disasterUI.SetActive(false); } }
void OnDisasterEncounter(Enums.Players player, Disaster disaster, bool hasEnoughForSacrifice) { DisasterUIInfo info = disasterUIInfos.Where(d => d.playerName == player).ToList()[0]; info.reqWineText.text = disaster.requiredWine.ToString(); info.reqFoodText.text = disaster.requiredFood.ToString(); info.reqFleeceText.text = disaster.requiredFleece.ToString(); info.disasterText.text = "Disaster Strikes:\n" + disaster.text + "\nRequired Resources ->"; if (hasEnoughForSacrifice) { playerUIs[player].panels[Enums.PlayerState.Disaster].GetComponentsInChildren <Text>()[1].color = Color.white; } else { playerUIs[player].panels[Enums.PlayerState.Disaster].GetComponentsInChildren <Text>()[1].color = Color.grey; } info.disasterUI.SetActive(true); }