using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using TMPro; public class DiffScale : MonoBehaviour { public TMP_Text textshowed; // Start is called before the first frame update void Start() { Ui.motiv = 5f; Ui.difficulty = 0f; Ui.nbObst = 5; } // Update is called once per frame void Update() { float ech = Ui.difficulty/10; transform.localScale = new Vector3 (ech,1,1); if (Ui.difficulty < 0) { Ui.difficulty = 0; } if (Ui.nbObst < 0) { Ui.nbObst = 0; } textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>(); textshowed.GetComponent<TMP_Text>().text = "Obstacles restants : " + Ui.nbObst.ToString(); } }