IEnumerator waitforDestory() { Boxes[] boxes = FindObjectsOfType(typeof(Boxes)) as Boxes[]; foreach (Boxes box in boxes) { Destroy(box.gameObject); yield return(new WaitForSeconds(0.2f)); } SpawnBox sb = FindObjectOfType(typeof(SpawnBox)) as SpawnBox; sb.SpawnNewBox(); txtInfo.text = ""; mask.DOFade(0, 0.5f); btnReplay.transform.DOMove(initBtnReplayPos, 0.5f); btnReplay.transform.DOScale(0.3f * Vector3.one, 0.5f); isPause = false; }
private void spawnNewPiece() { spawner.SpawnNewBox(); }