コード例 #1
0
ファイル: GetTimeLeftBomb.cs プロジェクト: pardo312/BoomAway
 // 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();
         }
     }
 }
コード例 #2
0
 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;
     }
 }