// Update is called once per frame void Update() { if (GameObject.FindGameObjectsWithTag("SelectedFoyer") != null || GameObject.FindGameObjectsWithTag("SelectedFoyer").Length != 0) { foyer = (InfectedScript)GameObject.FindGameObjectsWithTag("SelectedFoyer")[0].GetComponent("InfectedScript"); washingHands = foyer.getWashingHands(); quarantineRespect = foyer.getQuarantineRespect(); masks = foyer.getMasks(); nameFoyer = foyer.getNameFoyer(); libelleNameFoyer = this.transform.GetChild(0).GetComponentInChildren <Text>(); tauxQuarantineRespect = this.transform.GetChild(1).GetComponentInChildren <Text>(); tauxMasks = this.transform.GetChild(2).GetComponentInChildren <Text>(); tauxWashingHands = this.transform.GetChild(3).GetComponentInChildren <Text>(); sliderQuarantineRespect = this.transform.GetChild(4).GetComponentInChildren <Slider>(); sliderMasks = this.transform.GetChild(5).GetComponentInChildren <Slider>(); sliderWashingHands = this.transform.GetChild(6).GetComponentInChildren <Slider>(); libelleNameFoyer.text = nameFoyer; tauxQuarantineRespect.text = quarantineRespect.ToString(); tauxWashingHands.text = washingHands.ToString(); tauxMasks.text = masks.ToString(); sliderQuarantineRespect.value = quarantineRespect / 100f; sliderWashingHands.value = washingHands / 100f; sliderMasks.value = masks / 100f; } }
private float risqueTotal = 0; // Pourcentage // Start is called before the first frame update void Start() { //Debug.Log("okido"); infectedScript = GetComponentInChildren <InfectedScript>(); }