Ejemplo n.º 1
0
 void UpdateDialog()
 {
     m_content.text      = DialogPlayer.LoadContent();
     m_name.text         = DialogPlayer.LoadName();
     m_tachie.sprite     = DialogPlayer.LoadTachie();
     m_background.sprite = DialogPlayer.LoadBackground();
 }
Ejemplo n.º 2
0
 public void InitDialog()
 {
     if (DialogPlayer.IsReading())
     {
         UpdateDialog();
     }
 }
Ejemplo n.º 3
0
    void Awake()
    {
        mesh = GetComponentInChildren<TextMesh>();
        Instance = this;

        GameObject.FindWithTag("HUDCamera").camera.enabled = false;
    }
Ejemplo n.º 4
0
    public void Interact(DialogPlayer player)
    {
        int index = Random.Range(0, this.lines.Length);

        string line = this.lines[index];

        player.GetComponent <DialogSystem>().PushDialogLine(line);
    }
Ejemplo n.º 5
0
    void Start()
    {
        DialogPlayer player = GameObject.FindObjectOfType(typeof(DialogPlayer)) as DialogPlayer;

        if (player)
        {
            player.PlayDialog(dialog);
        }
    }
Ejemplo n.º 6
0
        private void Start()
        {
            dialogPlayer = FindObjectOfType <DialogPlayer>();
            if (!dialogPlayer)
            {
                Debug.LogWarning("No dialog player found in scene!");
            }


            UpdateScript(0);
            NewSelection(eventList.GetChild(0).GetComponent <DialogEventListItem>());
        }
Ejemplo n.º 7
0
    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");
    }
Ejemplo n.º 8
0
    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();
        }
    }
Ejemplo n.º 9
0
    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);
        }
    }
Ejemplo n.º 10
0
    // 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));
    }
Ejemplo n.º 11
0
        /// <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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        /// <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;
                }
            }
        }
Ejemplo n.º 14
0
 void Awake()
 {
     dialog_player = gameObject.AddComponent<DialogPlayer>();
     Debug.Log( dialog_player );
 }
Ejemplo n.º 15
0
 private void SelectTransition(DialogTransition dialogTransition)
 {
     _currentDialogNode = DialogPlayer.SelectNode(_dialog, _currentDialogNode, dialogTransition);
     UpdateCurrentNode();
 }
Ejemplo n.º 16
0
 private void Start()
 {
     //AddGameObject ();
     DialogPlayer.Load("first");
 }
Ejemplo n.º 17
0
 private void Start()
 {
     Instance = GetComponent <DialogPlayer>();
 }
 void CloseBox()
 {
     DialogPlayer.Load(m_name);
     Skyunion.UIManager.Instance().ClosePanel <InvestigateBoxPanel> ();
 }
Ejemplo n.º 19
0
 public void CallDialogPlayer()
 {
     DialogPlayer.PlaySelection();
 }
Ejemplo n.º 20
0
 public void Interact(DialogPlayer player)
 {
     player.GetComponent <DialogSystem>().PushDialog(this.lines);
 }
Ejemplo n.º 21
0
 public void Interact(DialogPlayer player)
 {
     player.GetComponent <DialogSystem>().PushDialogLine(this.text);
 }
Ejemplo n.º 22
0
 private void Start()
 {
     m_AudioData    = GetComponent <AudioSource>();
     m_DialogPlayer = GetComponent <DialogPlayer>();
 }
Ejemplo n.º 23
0
 private bool DialogPlayerMustBeSet(DialogPlayer value, ref string msg) => MustBeSet(value, ref msg);