private void ResetDeadAliens() { int mostAliensPerScene = 15; Debug.Log("RESETTING ALIENS DEAD IN SCENE, REMINDER WE ASSUME NO MORE THAN " + mostAliensPerScene); for (int i = 0; i < mostAliensPerScene; i++) { PlayerPrefs.SetInt(StayDeadAcrossTimeScript.alienNameForID(i), 1); } }
public void Explode(int chainDepth) { if (isExploded) { return; } Waypoint[] allWPChildrenToUnparent = GetComponentsInChildren <Waypoint>(); for (int i = 0; i < allWPChildrenToUnparent.Length; i++) { allWPChildrenToUnparent[i].transform.SetParent(null); } StayDeadAcrossTimeScript SDATS = GetComponent <StayDeadAcrossTimeScript>(); if (SDATS) { SDATS.WreckForAllTime(); } //GameObject testBlastVFX = Resources.Load("Explosion5m") as GameObject; //GameObject boomGO = GameObject.Instantiate(testBlastVFX, transform.position, transform.rotation); GameObject blastGO = GameObject.Instantiate(blastVFX, transform.position, transform.rotation); if (isUnderwater) { ParticleSystemRenderer[] allPSR = blastGO.GetComponentsInChildren <ParticleSystemRenderer>(); for (var i = 0; i < allPSR.Length; i++) { allPSR[i].material.SetColor("_Color", Color.blue); allPSR[i].material.SetColor("_EmissionColor", Color.cyan); if (allPSR[i].trailMaterial) { allPSR[i].trailMaterial.SetColor("_Color", Color.blue); allPSR[i].trailMaterial.SetColor("_EmissionColor", Color.cyan); } } } isExploded = true; StartCoroutine(ChainReact(chainDepth)); // compute chain reaction instantly, no lag }
public void ResetRowScore(int forRow) { int[] rowScores = ScorePerPeriod(forRow); TextMeshProUGUI[] labelRow = RowToLabelSet(forRow); sums[forRow] = 0; for (int i = 0; i < rowScores.Length; i++) { rowScores[i] = 0; //Random.Range(0, 10) * 50 + 0; sums[forRow] += rowScores[i]; labelRow[i].text = periodTimes[i] + "\nScore: " + rowScores[i]; HighScores.SaveHighScore((LevelName)forRow, (TimePeriod)i, 0); } sceneLabels[forRow].text = sceneNames[forRow] + "\nTotal: " + sums[forRow]; UpdateAllScore(); int mostAliensPerScene = 15; Debug.Log("RESETTING ALIENS DEAD IN SCENE, REMINDER WE ASSUME NO MORE THAN " + mostAliensPerScene); for (int i = 0; i < mostAliensPerScene; i++) { PlayerPrefs.SetInt(StayDeadAcrossTimeScript.alienForRow(forRow, i), 1); } }