//消灭灰色格子 public void RemoveGreyCell(Cell cell) { virusCount--; audioManager.PlaySound(3); GreyCells.Remove(cell); Destroy(cell.gameObject); }
//卸载所有关卡资源 public void UnloadLevel() { GreenCount = 0; FirstStep = true; GreyCells.Clear(); Destroy(GridRoot.gameObject); }
//放置灰色格子 public void PlaceGreyCell(Vector2Int pos) { GameObject grid = Instantiate(VirusGreyPrefab); grid.transform.parent = GridRoot.transform; grid.transform.localPosition = perUnitScale * (Vector2)pos; grid.transform.localScale *= perUnitScale; grid.GetComponent <Cell> ().SetIndex(pos.x, pos.y); GreyCells.Add(grid.GetComponent <Cell> ()); virusCount++; }