I am trying to use the Update() function to every frame update all texts (as shown below). It works perfectly fine in the Game View, and it even works while using the Unity Remote app by connecting the Android device via USB; but when I build the game and runnit fom that same Android device the Update() function doesn’s seem to be called. The function is inside a script which is attached as a Game Component to an empty object. Is there a way to make it work? Thanks!
Code:
void Update(){ //Update texts
GameObject.Find("Amount_Coal").GetComponent<UnityEngine.UI.Text>().text = Coal+ "/" + Space;
GameObject.Find("txtAmountCoins").GetComponent<UnityEngine.UI.Text>().text = Coins.ToString();
GameObject.Find("txt_PickaxePrice").GetComponent<UnityEngine.UI.Text>().text = ((int)Mathf.Round(Mathf.Pow(PickaxeLevel, 2) * 200) * (PickaxeLevel/25 + 1)).ToString();
GameObject.Find("txt_PriceInv").GetComponent<UnityEngine.UI.Text>().text = ((int)Mathf.Round(Mathf.Pow(LevelInv, 2) * 100) * (LevelInv/25 + 1)).ToString();
}