示例#1
0
 public void Pause()
 {
     if (CurrentSpeaker != null)
     {
         CurrentSpeaker.SetTalking(false);
         DialogSoundSource.Pause();
     }
 }
示例#2
0
        public void SetSpeaker(int index)
        {
            if (index >= Participants.Length)
            {
                Debug.LogError("Trying to make participant #" + index + " the speaker but there are only " + (Participants.Length - 1) + " participants");
                return;
            }
            DialogParticipant newParticipant = Participants[index];

            if (newParticipant == null)
            {
                Debug.LogError("Speaker of " + index + "is null");
                return;
            }

            ShutUpCurrentSpeaker();

            CurrentSpeaker = newParticipant;
            CurrentSpeaker.SetTalking(true);
            if (DialogSoundSource != null)
            {
                DialogSoundSource.transform.parent        = CurrentSpeaker.GetHeadTransform();
                DialogSoundSource.transform.localPosition = Vector3.zero;
            }
        }