void UpdateDialog() { m_content.text = DialogPlayer.LoadContent(); m_name.text = DialogPlayer.LoadName(); m_tachie.sprite = DialogPlayer.LoadTachie(); m_background.sprite = DialogPlayer.LoadBackground(); }
public void InitDialog() { if (DialogPlayer.IsReading()) { UpdateDialog(); } }
void Awake() { mesh = GetComponentInChildren<TextMesh>(); Instance = this; GameObject.FindWithTag("HUDCamera").camera.enabled = false; }
public void Interact(DialogPlayer player) { int index = Random.Range(0, this.lines.Length); string line = this.lines[index]; player.GetComponent <DialogSystem>().PushDialogLine(line); }
void Start() { DialogPlayer player = GameObject.FindObjectOfType(typeof(DialogPlayer)) as DialogPlayer; if (player) { player.PlayDialog(dialog); } }
private void Start() { dialogPlayer = FindObjectOfType <DialogPlayer>(); if (!dialogPlayer) { Debug.LogWarning("No dialog player found in scene!"); } UpdateScript(0); NewSelection(eventList.GetChild(0).GetComponent <DialogEventListItem>()); }
private void OnTriggerEnter(Collider other) { if (TmpDate.m_investigatePoint >= diff) { DialogPlayer.Load("StewardSuccess"); Debug.Log("-------FINISH!!!!!!!!--------"); } else { DialogPlayer.Load("StewardFailure"); Debug.Log("-------FINISH!!!!!!!!--------"); } GetComponent <Animation> ().Play("OpenGateDoor"); }
void UpdateContent(BaseEventData eventData) { if (DialogPlayer.IsReading()) { UpdateDialog(); } else { GameObject.Find("RigidBodyFPSController").GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController> ().mouseLook.SetCursorLock(true); UIManager.Instance().ClosePanel <UIDialogPanel> (); Camera.main.GetComponent <RayCastDetection> ().OpenDetection(); } }
private void UpdateCurrentNode() { DialogNodeText.text = _currentDialogNode.Text; foreach (Transform transitionTransform in DialogTransitionParent) { var transitionViewModel = transitionTransform.GetComponent <DialogTransitionViewModel>(); transitionViewModel.Clicked -= TransitionViewModel_Clicked; RemoveTransitionControl(transitionViewModel); } var availableTransitions = DialogPlayer.GetAvailableTransitions(_dialog, _currentDialogNode); foreach (var transition in availableTransitions) { CreateTransitionViewModel(transition, DialogTransitionParent); } }
// Start is called before the first frame update void Start() { this.DialogPanel.enabled = false; this.DialogText.text = string.Empty; if (this.dialogPlayer == null) { this.dialogPlayer = this.gameObject.AddComponent <DialogPlayer>(); } this.dialogPlayer.SectionStarted += this.SectionStarted; this.dialogPlayer.TextUpdated += this.TextUpdated; if (this.DialogSpeakerName != null) { this.defaultSpeakerNameColor = this.DialogSpeakerName.color; } if (this.QuestPanel) { this.QuestPanel.enabled = false; this.questPanelRectTransform = this.QuestPanel.GetComponent <RectTransform>(); this.originalQuestPanelPosition = this.questPanelRectTransform.anchoredPosition; this.questTween = this.QuestPanel.GetComponent <EasyTween>(); this.questTween.enabled = false; } if (this.CurrentQuestPanel) { this.CurrentQuestPanel.enabled = false; var objectivesPanel = this.CurrentQuestPanel.GetComponentsInChildren <Canvas>().SingleOrDefault(x => x.name == "ObjectivesPanel"); if (objectivesPanel != null) { this.questObjectivesController = objectivesPanel.GetComponent <QuestObjectivesController>(); if (this.questObjectivesController != null) { this.questObjectivesController.Controller = this.Controller; } } } this.questAnimationDoneEvent.AddListener(new UnityAction(this.OnQuestAnimationDone)); }
/// <summary> /// Starts saying the reply by this <see cref="DialogActor"/>, /// and returns the total length of the audio clips corresponding to the reply in the specified language if it isn't text only. /// If it is, returns 0. /// </summary> /// <param name="reply">The <see cref="Reply"/> to say.</param> /// <returns>Returns the length of the audio clip corresponding to the reply in the current language. Returns 0 if it is text only.</returns> public float SayReply(Reply reply, DialogPlayer associatedPlayer) { LocalizedReply currentLanguageReply = reply.GetReplyForLanguage(DialogEngineRuntime.Instance.DialogLanguage); if (currentLanguageReply == null) { throw new Exception("The language you are trying to use is not defined in the reply you are trying to say. Reply name: " + reply.name); } if (playReplyCoroutine != null) { StopCoroutine(playReplyCoroutine); } playReplyCoroutine = StartCoroutine(PlayReplyCoroutine(currentLanguageReply, associatedPlayer, reply.TextOnly)); if (reply.TextOnly) { return(GetMutedReplyPlayingTime(currentLanguageReply)); } return(currentLanguageReply.CompleteLength); }
public float SayReply(Reply reply, DialogPlayer associatedPlayer, string forcedLanguage) { LocalizedReply currentLanguageReply = reply.GetReplyForLanguage(forcedLanguage); if (currentLanguageReply == null) { throw new Exception("The language you are trying to use is not defined in the reply you are trying to say."); } if (playReplyCoroutine != null) { StopCoroutine(playReplyCoroutine); } playReplyCoroutine = StartCoroutine(PlayReplyCoroutine(currentLanguageReply, associatedPlayer, reply.TextOnly)); if (reply.TextOnly) { return(0); } return(currentLanguageReply.CompleteLength); }
/// <summary> /// The coroutine responsible of playing the reply: it plays all the reply parts, waits the user-specified time /// between each part etc. /// </summary> /// <param name="localizedReply">The reply in the current language.</param> /// <param name="associatedPlayer">The player of the reply.</param> /// <param name="textOnly">Is this reply text only?</param> private IEnumerator PlayReplyCoroutine(LocalizedReply localizedReply, DialogPlayer associatedPlayer, bool textOnly) { PlayingDialog = true; for (int i = 0; i < localizedReply.SubParts.Count; i++) { // Get the current reply ReplyPart currentPart = localizedReply.SubParts[i]; // Set the current audio file if (!textOnly) { audioSource.clip = currentPart.Audio; } // Wait the specified amount of time before saying the reply and then play it yield return(new WaitForSeconds(currentPart.DelayBeforePlaying)); // Show the current subtitles if (associatedPlayer != null) { associatedPlayer.CurrentReplySubtitles = currentPart.Subtitles; // Set the subtitles AFTER waiting for muted dialogs } if (!textOnly) { audioSource.PlayOneShot(currentPart.Audio); // Then wait for the end of this reply part yield return(new WaitForSeconds(currentPart.Audio.length)); PlayingDialog = false; } else { yield return(new WaitForSeconds(0.1f)); PlayingDialog = false; } } }
void Awake() { dialog_player = gameObject.AddComponent<DialogPlayer>(); Debug.Log( dialog_player ); }
private void SelectTransition(DialogTransition dialogTransition) { _currentDialogNode = DialogPlayer.SelectNode(_dialog, _currentDialogNode, dialogTransition); UpdateCurrentNode(); }
private void Start() { //AddGameObject (); DialogPlayer.Load("first"); }
private void Start() { Instance = GetComponent <DialogPlayer>(); }
void CloseBox() { DialogPlayer.Load(m_name); Skyunion.UIManager.Instance().ClosePanel <InvestigateBoxPanel> (); }
public void CallDialogPlayer() { DialogPlayer.PlaySelection(); }
public void Interact(DialogPlayer player) { player.GetComponent <DialogSystem>().PushDialog(this.lines); }
public void Interact(DialogPlayer player) { player.GetComponent <DialogSystem>().PushDialogLine(this.text); }
private void Start() { m_AudioData = GetComponent <AudioSource>(); m_DialogPlayer = GetComponent <DialogPlayer>(); }
private bool DialogPlayerMustBeSet(DialogPlayer value, ref string msg) => MustBeSet(value, ref msg);