private void FixedUpdate() { //Null check if (ZoneCompleteText != null) { //Update the instance ZoneCompleteText.Update(); //Check to see if we still need the object if (!ZoneCompleteText.DisplayText && m_still_playing) { if (ZoneLevel > 1) { asteroidSpawner.state = AsteroidSpawner.State.Normal; Debug.Log("Normal"); } ZoneCompleteText = null; //Set to null, garbage collector kills this PlanetControllerScript.DeletePlanet(); PlanetControllerScript.SpawnPlanet(); } } if (nextZone) { if (timer.GetHasFinished() == true) { //Update the color ColorScript.ChangeColor(); ResetParticleSystems(); nextZone = false; PlanetControllerScript.SpeedOff(); ZoneCompleteText = new TextManager(CompleteLevelTextObject, particlesystem, FeelGoodWords[Random.Range(0, FeelGoodWords.Capacity)], 0.5f, 4.0f); } else { timer.Update(); } } }
public void StopGame() { AnalyticsEvent.LevelQuit(ZoneScript.ZoneLevel); DeletePlayer(); if (ZoneScript.ZoneCompleteText != null) { ZoneScript.ZoneCompleteText.DisplayText = false; } PlanetScript.DeletePlanet(); GameObject objectController = GameObject.FindGameObjectWithTag("ObjectController"); DeleteObjectStuff(objectController); foreach (ParticleSystem ps in ZoneScript.ParticleSystems) { ps.Stop(); } ZoneScript.CancelZone(); }