public void ResolveChoice(EpisodeChoice choice) { foreach (var score in choice.Scores) { AddScore(score); } }
public void SetCurrentTimeOut(EpisodeChoice choice, float timeLeft) { if (choice != null) { VigController.SetIntensity(IntensityCurve.Evaluate(timeLeft)); } }
public void SelectChoice(EpisodeChoice choice) { if (!Playing) { return; } toController.CancelTimeOut(); Playing = false; StartCoroutine(ResolveEpisode(CurrentEpisode, choice)); }
public void SetChoice(EpisodeChoice choice) { Choice = choice; foreach (var text in Texts) { text.text = Choice.Text; } ShowColors(choice); }
public void SpawnChoice(EpisodeChoice choice, bool isDark) { GameObject bubble = GameObject.Instantiate(GameConfig.Instance.EpisodeBubblePrefab, transform.position, GameConfig.Instance.EpisodeBubblePrefab.transform.rotation); bubble.GetComponent <EpisodeChoiceBubble>().SetChoice(choice); bubble.GetComponent <EpisodeChoiceBubble>().SetTargetVelocity(m_VelocityToSet); if (isDark) { bubble.GetComponent <EpisodeChoiceBubble>().SetDark(choice); } }
public void SetDark(EpisodeChoice choice) { if (IsDark) { return; } SetChoice(choice); IsDark = true; NormalObject.SetActive(false); DarkObject.SetActive(true); }
private IEnumerator ShowFailedToMakeChoice(Episode episode, EpisodeChoice timeOutChoice) { Playing = false; EpisodeManager.Instance.DisplayFailedToChoose(timeOutChoice); while (EpisodeManager.Instance.ShowingMessage) { yield return(null); } yield return(new WaitForSeconds(1f)); toController.CancelTimeOut(); StartCoroutine(ResolveEpisode(CurrentEpisode, timeOutChoice)); }
private IEnumerator ResolveEpisode(Episode episode, EpisodeChoice choice) { Resolving = true; yield return(new WaitForSeconds(1f)); EpisodeManager.Instance.DisplayResolveEpisode(episode, choice); while (EpisodeManager.Instance.ShowingMessage) { yield return(null); } if (choice.PlotToApply != null) { PlotManager.Instance.TriggerPlot(choice.PlotToApply); } while (EpisodeManager.Instance.ShowingMessage) { yield return(null); } HealthManager.Instance.ChangeHealth(choice.HealthChange); yield return(new WaitForSeconds(1f)); if (HealthManager.Instance.Health <= 0) { StartCoroutine(LoseGame()); } else if (choice.EndsGame) { StartCoroutine(FinishGame()); } else { StartCoroutine(EnterEpisode(choice.NextScene)); } }
private void AttemptSpawnGremlin() { if (EpisodeChoiceBubble.CurrentBubbles.Count == 0) { return; } foreach (var bubble in EpisodeChoiceBubble.CurrentBubbles) { if (!bubble.IsDark) { sValidChoices.Add(bubble); } } if (sValidChoices.Count == 0) { sValidChoices.Clear(); return; } sValidChoices.Clear(); if (GameStateManager.Instance.CurrentEpisode == null) { return; } EpisodeChoice darkChoice = GameStateManager.Instance.CurrentEpisode.GetRandomDarkChoice(); if (darkChoice == null) { return; } GameObject spawned = Instantiate(PrefabToSpawn, transform.position, PrefabToSpawn.transform.rotation); spawned.GetComponent <Gremlin>().SetDarkChoice(darkChoice); }
private void ShowColors(EpisodeChoice choice) { if (choice.Scores.Count == 1) { leftGlow.enabled = rightGlow.enabled = true; leftGlow.color = rightGlow.color = choice.Scores[0].Type.Color; } else if (choice.Scores.Count == 2) { leftGlow.enabled = rightGlow.enabled = true; leftGlow.color = choice.Scores[0].Type.Color; rightGlow.color = choice.Scores[1].Type.Color; } else if (choice.Scores.Count == 4) { allColorGlow.gameObject.SetActive(true); } else { leftGlow.enabled = rightGlow.enabled = false; } }
private IEnumerator PlayEpisode(Episode episode) { Playing = true; EpisodeChoice timeOutChoice = episode.GetRandomDarkChoice(); float timeLeft = TimeUntilTimeOut; EpisodeManager.Instance.DisplayPlayingEpisode(episode); while (Playing) { /* * if (timeOutChoice != null) * { * timeLeft -= Time.deltaTime; * toController.SetCurrentTimeOut(timeOutChoice, timeLeft); * * if (timeLeft <= 0f) * yield return StartCoroutine(ShowFailedToMakeChoice(episode, timeOutChoice)); * } */ yield return(null); } }
public void DisplayFailedToChoose(EpisodeChoice timeOutChoice) { DescriptionUI.PlayMessage(timeOutChoice.Text); }
public void DisplayResolveEpisode(Episode episode, EpisodeChoice choice) { DescriptionUI.PlayMessage(choice.Outcome); }
public EpisodeChoice GetRandomDarkChoice() { return(EpisodeChoice.GetRandomChoice(DarkChoices)); }
public void SetDarkChoice(EpisodeChoice darkChoice) { DarkChoice = darkChoice; }