/// <summary>Tries Progresses the dialogue by switching display if necessary and dislay the next line on screen. Returns false if the end of monologues has been reached.</summary> public bool Continue(ref int indexAt) { indexAt++; if (indexAt == monologues.Length) { return(false); } if (hasSwitched) { activeDisplay.SetActive(false); activeDisplay = leftIsActive ? leftDisplay : rightDisplay; activeDisplay.SetActive(true); hasSwitched = false; } activeDisplay.text = monologues[indexAt].Line; if (monologues[indexAt].IsLast) { leftIsActive = !leftIsActive; hasSwitched = true; } return(true); }
/// <summary>Resets the dialogue state</summary> public void Restore() { display?.SetActive(false); display = null; AnyActive = false; }
public void SetupDisplay(AudableCharacterDisplay leftDisplay, AudableCharacterDisplay rightDisplay) { this.leftDisplay = leftDisplay; this.rightDisplay = rightDisplay; leftDisplay.SetActive(false); rightDisplay.SetActive(false); leftDisplay.sprite = leftCharacter.DisplaySprite; rightDisplay.sprite = rightCharacter.DisplaySprite; leftIsActive = startLeft; activeDisplay = leftIsActive ? leftDisplay : rightDisplay; }