// This function is to select the next audition who will be shown, from the list of auditions remaining in the round. private void NextAudition() { // Check if the round is now over if (auditionsLeftInRound.Count < 1) { InsultManager.Instance.OnRoundEnded(); ShowRecapScene(); return; } // Pick the next audition if (randomizeAuditionOrder) { int r = Random.Range(0, auditionsLeftInRound.Count); currentAudition = auditionsLeftInRound[r]; auditionsLeftInRound.RemoveAt(r); } else { currentAudition = auditionsLeftInRound[0]; auditionsLeftInRound.RemoveAt(0); } // Set any relevant visuals characterProfile.SetActive(true); currentAudition.transform.position = new Vector2(0.0f, 0.5f); CastMember cm = currentAudition.GetComponent <CastMember>(); if (cm) { SpriteRenderer sr = cm.GetSprite(); sr.material = defaultMaterial; Color c = sr.color; c.r = 1.0f; c.g = 1.0f; c.b = 1.0f; sr.color = c; } }
// This function displays the recap scene at the end of the round, from which the player can then move on to the next round. private void ShowRecapScene() { showingRecap = true; recapMenu.SetActive(true); InsultManager.Instance.OnStopCountdown(); List <CastMember> cmlist = new List <CastMember>(); int survivors = 0; foreach (GameObject audition in selectedAuditionsList) { CastMember cm = audition.GetComponent <CastMember>(); cm.OnRelax(); if (cm.GetEliminatedInRound() == currentRound) // Actor was eliminated this round { cmlist.Add(cm); } else if (cm.GetEliminatedInRound() == 0) // Actor is still in the game { cmlist.Add(cm); survivors++; } } if (survivors < 1) { NextRoundButton.SetActive(false); AdmitDefeatButton.SetActive(false); celebrateVictoryButton.SetActive(true); } int auditionsInRound = cmlist.Count; float midpoint = (auditionsInRound - 1) / 2.0f; int i = 0; foreach (CastMember cm in cmlist) { cm.SetSilent(true); cm.OnFadeIn(1.0f); cm.gameObject.SetActive(true); float pc = recapScreenPercent / 100.0f; float offset = ((i - midpoint) / (auditionsInRound + 1)) * pc; Vector2 pos = Camera.current.ViewportToWorldPoint(new Vector3(0.5f + offset, 0.5f, 0.0f)); cm.gameObject.transform.position = pos; if (cm.GetEliminatedInRound() == currentRound) { SpriteRenderer sr = cm.GetSprite(); sr.material = greyscaleMaterial; Color c = sr.color; c.r *= darkenAmount; c.g *= darkenAmount; c.b *= darkenAmount; sr.color = c; } i++; } }