static bool CheckIfBoxesAreFalling() { bool falling = false; for (int i = 0; i < BoxScript.GridWidth; ++i) { if (BoxScript.IsBoxInColumnFalling(i) || !BoxScript.IsColumnFull(i)) { falling = true; break; } } return(falling); }
void Update() { if (BoxScript.grid[myX, BoxScript.GridHeight - 1] == null && !BoxScript.IsBoxInColumnFalling(myX)) { if (_init && _initCount < 9) { ++_initCount; SpawnNewBox(); if (_initCount == 9) { isInit = true; } } else if (_wait) { StartCoroutine(WaitForSpawn()); _wait = false; _init = false; } } }