IEnumerator Dissolve(GameObject obj) { float t = 0.0f; while (t <= 2.0f) { obj.GetComponent <MeshRenderer>().material.SetFloat("_DissolveThreshold", t / 2f); t += Time.deltaTime; yield return(null); } GameObject.Destroy(obj); fishManager.ResetFish(); }
void ResetGame() { //Revert to original state title.SetAlpha(0f); title.FadeTo(1f, 2f); fishManager.ResetFish(); foodManager.ResetFood(); enemyManager.ResetEnemies(); score = 0; SetScore(score); }