Exemplo n.º 1
0
        private IEnumerator SpawnNewGems()
        {
            yield return(new WaitForSeconds(spawnDelay));

            bool iSpawn = false;

            for (int j = 0; j < _allObjects.GetLength(1); j++)
            {
                if (_allObjects[_allObjects.GetLength(0) - 1, j].GetComponent <Empty>() != null)
                {
                    iSpawn = true;
                    GameObject trash = _allObjects[_allObjects.GetLength(0) - 1, j];
                    _allObjects[_allObjects.GetLength(0) - 1, j] = _tilesHolder.CreateFruit(new Vector3(_allObjects[_allObjects.GetLength(0) - 1, j].transform.position.x, _allObjects[_allObjects.GetLength(0) - 1, j].transform.position.y + 0.82f), _allObjects.GetLength(0) - 1, j);
                    Destroy(trash);
                    _allObjects[_allObjects.GetLength(0) - 1, j].GetComponent <Animeted>().SmoothCreate();
                }
            }
            AfterSpawn(iSpawn);
            yield break;
        }