void Update() { //ifラウンドがリセットされていたらRoundLoadを呼び出し if (roundReset) { roundReset = false; RoundLoad(); if (timeLimit >= 3.0f) { timeLimit -= 0.2f; } } timer += Time.deltaTime; //オブジェクトの表示時間を設定 //表示時間終了時にChestのTimeKeeperを呼ぶ if (timer >= timeLimit && timerActive) { timer = 0; timerActive = false; for (int i = 0; i < chestsObj.Length; i++) { chestscr = chestsObj[i].GetComponent <Chest>(); chestscr.AnimationStart(); } } if (gameoverTile.activeSelf) { if (Input.GetKeyDown("r")) { gameoverTile.SetActive(false); score = 0; hp = 3; ResetChest(); } } }