/// <summary>Resets the dialogue state</summary> public void Restore() { hasSwitched = false; activeDisplay?.SetActive(false); activeDisplay = null; }
/// <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; }
/// <summary> /// prepares the monologue to be played /// </summary> /// <param name="display"></param> public void SetupDisplay(AudableCharacterDisplay display) { AnyActive = true; this.display = display; this.display.sprite = character.DisplaySprite; }
/// <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(AudableCharacterDisplay display, ref int indexAt) { indexAt++; if (indexAt == lines.Length) { return(false); } display.text = lines[indexAt]; return(true); }
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; }