// Update is called once per frame void Update() { if (GameObject.Find("Bomb(Clone)") != null) { bombScript = GameObject.Find("Bomb(Clone)").GetComponent <BoomAway.Assets.Scripts.Game.Player.Guns.Bomb>(); if (!bombScript.readyToExplode) { GetComponent <TextMeshProUGUI>().text = Mathf.Ceil(bombScript.timeUntilExplode).ToString(); } } }
void Update() { if (GameObject.Find("Bomb(Clone)") != null) { found = true; bombScript = GameObject.Find("Bomb(Clone)").GetComponent <BoomAway.Assets.Scripts.Game.Player.Guns.Bomb>(); if (bombScript.readyToExplode && !Grid.gameStateManager.editing) { if (TryGetComponent <TextMeshPro>(out TextMeshPro tmp)) { transform.rotation = Quaternion.identity; tmp.text = Mathf.Ceil(bombScript.timeUntilExplode).ToString(); } } } else { found = false; } }