public void DestroyRandom() { dropFruit(); if (PlayerInfo.MODE == 1) { if (!IsStar) { List <CellObj> listeff = getListCellEffect(); if (listeff.Count > 0) { CellObj tmp = listeff[Random.Range(0, listeff.Count)]; tmp.RemoveEffect(); EffectSpawner.effect.Thunder(GridManager.grid.GridCell[(int)tmp.Cell.CellPosition.x, (int)tmp.Cell.CellPosition.y].transform.position); } else { destroyNotEmpty(); } } else { Vector2 vtmp = posUnderStar(); FruitObj tmp = FruitSpawner.spawn.FruitGridScript[(int)vtmp.x, (int)vtmp.y]; if (tmp != null && tmp != FruitStar) { tmp.Destroy(); EffectSpawner.effect.Thunder(GridManager.grid.GridCell[(int)tmp.Fruit.FruitPosition.x, (int)tmp.Fruit.FruitPosition.y].transform.position); } } } }
IEnumerator DestroyType(int type, Vector3 pos) { NoSelector.SetActive(true); dropFruit(); for (int x = 0; x < 7; x++) { for (int y = 0; y < 9; y++) { FruitObj tmp = FruitSpawner.spawn.FruitGridScript[x, y]; if (tmp != null && tmp.Fruit.FruitType == type) { //生成特效 tmp.Destroy(); } } } yield return(new WaitForSeconds(0.2f)); NoSelector.SetActive(false); }