Ejemplo n.º 1
0
 public void RaiseEvent(LocalizedString line, ActorSO actor)
 {
     if (OnEventRaised != null)
     {
         OnEventRaised.Invoke(line, actor);
     }
 }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
     }
 }
Ejemplo n.º 5
0
    //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();
                }
            }
        }
    }
Ejemplo n.º 6
0
 bool HasStep(ActorSO actorToCheckWith)
 {
     if (_currentStep != null)
     {
         if (_currentStep.Actor == actorToCheckWith)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 private void OnLineDisplayed(LocalizedString line, ActorSO actor)
 {
     if (actor.ActorName == _protagonistActor.ActorName)
     {
         _isNPCSayingTheLine = false;
     }
     else
     {
         _isNPCSayingTheLine = true;
     }
 }
Ejemplo n.º 9
0
    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
    }
Ejemplo n.º 10
0
    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}");
    }
Ejemplo n.º 11
0
 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;
 }
Ejemplo n.º 12
0
    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;
        }
    }
Ejemplo n.º 13
0
 public void SetDialogue(string dialogueLine, ActorSO actor)
 {
     _lineText.SetText($"{actor.ActorName}: { dialogueLine}");
 }
Ejemplo n.º 14
0
 void PlayDialogueFromClip(LocalizedString dialogueLine, ActorSO actor)
 {
     _dialogueManager.DisplayDialogueLine(dialogueLine, actor);
 }
Ejemplo n.º 15
0
 public void SetDialogue(LocalizedString dialogueLine, ActorSO actor)
 {
     _choicesManager.gameObject.SetActive(false);
     _lineText.StringReference      = dialogueLine;
     _actorNameText.StringReference = actor.ActorName;
 }
Ejemplo n.º 16
0
 public void SetActor(ActorSO newActor)
 {
     //_actor = newActor;
 }
Ejemplo n.º 17
0
 private void OpenUIDialogue(string dialogueLine, ActorSO actor)
 {
     _dialoguePanel.SetDialogue(dialogueLine, actor);
     _dialoguePanel.gameObject.SetActive(true);
 }
 private void OnLineDisplayed(LocalizedString line, ActorSO actor)
 {
     _isAnewLineDisplayed = true;
 }
Ejemplo n.º 19
0
 public void OpenUIDialogue(LocalizedString dialogueLine, ActorSO actor)
 {
     _dialogueController.SetDialogue(dialogueLine, actor);
     _dialogueController.gameObject.SetActive(true);
 }
Ejemplo n.º 20
0
 private void PlayDialogueFromClip(string dialogueLine, ActorSO actor)
 {
     _dialogueManager.DisplayDialogueLine(dialogueLine, actor);
 }
Ejemplo n.º 21
0
 public IsNPCSayingTheLineCondition(DialogueLineChannelSO sayLineEvent, ActorSO protagonistActor)
 {
     _sayLineEvent     = sayLineEvent;
     _protagonistActor = protagonistActor;
 }