public override void OpenTalkPrompt(DialogueActer dialogueActer)
 {
     if (IsEnabled())
     {
         PromptController.Open(dialogueActer);
     }
 }
 public void Open(DialogueActer acter)
 {
     acter.OnDeselected();
     if (CandidateActer == null)
     {
         SetCandidate(acter);
     }
     Candidates.Add(acter);
     // Enable potential canvas
 }
        public override void StartDialogue(DialogueActer acter)
        {
            if (IsEnabled() && IsReady())
            {
                CurrentActer = acter;

                SwitchToMain();
                MainDialogueSystem.StartDialogue(acter);
            }
        }
        private float CalculateDistanceToPlayer(DialogueActer acter)
        {
            float distance = float.PositiveInfinity;

            if (acter != null)
            {
                distance = CalculateSqrMagnitudeDistanceToPlayer(acter.transform.position);
            }

            return(distance);
        }
        public override void OnDialogueEnded()
        {
            if (CurrentActer != null && CurrentActer.IsBlocking)
            {
                base.OnDialogueEnded();
            }

            CurrentActer?.OnEndTalk();
            CurrentActer = null;

            StopAllCoroutines();

            TextManager.Close();
            VoiceManager.Close();
        }
 public void Close(DialogueActer acter)
 {
     Candidates.Remove(acter);
     if (CandidateActer.Equals(acter))
     {
         CandidateActer = null;
         if (Candidates.Count() == 1)
         {
             SetCandidate(Candidates.First());
         }
         else if (Candidates.Count() > 1)
         {
             UpdateCandidate();
         }
     }
     // Disable potential canvas
 }
        private void UpdateCandidate()
        {
            DialogueActer currentCandidate = CandidateActer;
            float         currentDistance  = CalculateDistanceToPlayer(CandidateActer);

            foreach (DialogueActer acter in Candidates)
            {
                float otherDistance = CalculateDistanceToPlayer(acter);

                if (otherDistance < currentDistance)
                {
                    currentCandidate = acter;
                    currentDistance  = otherDistance;
                }
            }

            if (CandidateActer != currentCandidate) // Si se ha encontrado un candidato más cercano
            {
                CandidateActer?.OnDeselected();
                SetCandidate(currentCandidate);
            }
        }
Пример #8
0
 public abstract void CloseTalkPrompt(DialogueActer dialogueActer);
Пример #9
0
 public abstract void OpenTalkPrompt(DialogueActer dialogueActer);
Пример #10
0
 public abstract void StartDialogue(DialogueActer acter);
        private void SetCandidate(DialogueActer acter)
        {
            CandidateActer = acter;

            CandidateActer.OnSelected();
        }
 void Start()
 {
     Acter = GetComponent <DialogueActer>();
 }
 public override void CloseTalkPrompt(DialogueActer dialogueActer)
 {
     PromptController.Close(dialogueActer);
 }