public void RaiseEvent(LocalizedString line, ActorSO actor) { if (OnEventRaised != null) { OnEventRaised.Invoke(line, actor); } }
public DialogueDataSO InteractWithCharacter(ActorSO actor, bool isCheckValidity, bool isValid) { if (_currentQuest == null) { if (CheckQuestlineForQuestWithActor(actor)) { StartQuest(actor); } } if (HasStep(actor)) { if (isCheckValidity) { if (isValid) { return(_currentStep.CompleteDialogue); } else { return(_currentStep.IncompleteDialogue); } } else { return(_currentStep.DialogueBeforeStep); } } return(null); }
void OpenUIDialogue(LocalizedString dialogueLine, ActorSO actor) { bool isProtagonistTalking = (actor == _mainProtagonist); _dialogueController.SetDialogue(dialogueLine, actor, isProtagonistTalking); _dialogueController.gameObject.SetActive(true); }
public void RaiseEvent(ActorSO actor) { if (OnEventRaised != null) { OnEventRaised.Invoke(actor); } }
//When Interacting with a character, we ask the quest manager if there's a quest that starts with a step with a certain character void StartQuest(ActorSO actorToCheckWith) { if (_currentQuest != null) //check if there's a current quest { return; } if (_currentQuestline != null) { //find quest index _currentQuestIndex = _currentQuestline.Quests.FindIndex(o => !o.IsDone && o.Steps != null && o.Steps[0].Actor == actorToCheckWith); if ((_currentQuestline.Quests.Count > _currentQuestIndex) && (_currentQuestIndex >= 0)) { _currentQuest = _currentQuestline.Quests[_currentQuestIndex]; //start Step _currentStepIndex = 0; _currentStepIndex = _currentQuest.Steps.FindIndex(o => o.IsDone == false); if (_currentStepIndex >= 0) { StartStep(); } } } }
bool HasStep(ActorSO actorToCheckWith) { if (_currentStep != null) { if (_currentStep.Actor == actorToCheckWith) { return(true); } } return(false); }
bool CheckQuestlineForQuestWithActor(ActorSO actorToCheckWith) { if (_currentQuest == null) //check if there's a current quest { if (_currentQuestline != null) { return(_currentQuestline.Quests.Exists(o => !o.IsDone && o.Steps != null && o.Steps[0].Actor == actorToCheckWith)); } } return(false); }
private void OnLineDisplayed(LocalizedString line, ActorSO actor) { if (actor.ActorName == _protagonistActor.ActorName) { _isNPCSayingTheLine = false; } else { _isNPCSayingTheLine = true; } }
public void SetDialogue(LocalizedString dialogueLine, ActorSO actor, bool isMainProtagonist) { _choicesManager.gameObject.SetActive(false); _lineText.StringReference = dialogueLine; _actorNamePanel.SetActive(!isMainProtagonist); _mainProtagonistNamePanel.SetActive(isMainProtagonist); if (!isMainProtagonist) { _actorNameText.StringReference = actor.ActorName; } //Protagonist's LocalisedString is provided on the GameObject already }
public void SetDialogue(string dialogueLine, ActorSO actor) { if (_typewriterEffect) { _typewriterEffect.Run(dialogueLine, _lineText); } else { _lineText.SetText(dialogueLine); Debug.Log("Attached Typewriter component for typewriter effect."); } _actorNameText.SetText($"{actor.ActorName}"); }
public DialogueDataSO(DialogueDataSO dialogue) { _actor = dialogue.Actor; _dialogueLines = new List <LocalizedString>(dialogue.DialogueLines); _choices = new List <Choice>(); _endOfDialogueEvent = dialogue.EndOfDialogueEvent; if (dialogue.Choices != null) { for (int i = 0; i < dialogue.Choices.Count; i++) { _choices.Add(new Choice(dialogue.Choices[i])); } } _dialogueType = dialogue.DialogueType; }
public void OpenUIDialogue(string dialogueLine, ActorSO actor) { _dialoguePanel.SetDialogue(dialogueLine, actor); _dialoguePanel.transform.GetChild(0).gameObject.SetActive(true); _HUDPanel.gameObject.SetActive(false); if (_interactionPanel.gameObject.activeSelf) { wasInteractionActive = true; _interactionPanel.gameObject.SetActive(false); } else { wasInteractionActive = false; } }
public void SetDialogue(string dialogueLine, ActorSO actor) { _lineText.SetText($"{actor.ActorName}: { dialogueLine}"); }
void PlayDialogueFromClip(LocalizedString dialogueLine, ActorSO actor) { _dialogueManager.DisplayDialogueLine(dialogueLine, actor); }
public void SetDialogue(LocalizedString dialogueLine, ActorSO actor) { _choicesManager.gameObject.SetActive(false); _lineText.StringReference = dialogueLine; _actorNameText.StringReference = actor.ActorName; }
public void SetActor(ActorSO newActor) { //_actor = newActor; }
private void OpenUIDialogue(string dialogueLine, ActorSO actor) { _dialoguePanel.SetDialogue(dialogueLine, actor); _dialoguePanel.gameObject.SetActive(true); }
private void OnLineDisplayed(LocalizedString line, ActorSO actor) { _isAnewLineDisplayed = true; }
public void OpenUIDialogue(LocalizedString dialogueLine, ActorSO actor) { _dialogueController.SetDialogue(dialogueLine, actor); _dialogueController.gameObject.SetActive(true); }
private void PlayDialogueFromClip(string dialogueLine, ActorSO actor) { _dialogueManager.DisplayDialogueLine(dialogueLine, actor); }
public IsNPCSayingTheLineCondition(DialogueLineChannelSO sayLineEvent, ActorSO protagonistActor) { _sayLineEvent = sayLineEvent; _protagonistActor = protagonistActor; }