示例#1
0
 protected virtual void NotifyCurrentDialogueStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue self, IDialogueOwner owner)
 {
     if (OnCurrentDialogueStatusChanged != null)
     {
         OnCurrentDialogueStatusChanged(before, after, self, owner);
     }
 }
示例#2
0
 public DialogueEvent(int id, List <DialoguePage> textPages, int index, string sound = "", DialogueStatus status = DialogueStatus.Start, bool isControllable = true)
 {
     _id             = id;
     _index          = index;
     _textPages      = textPages;
     _sound          = sound;
     _status         = status;
     _isControllable = isControllable;
 }
示例#3
0
 protected virtual void DialogueOnStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue self, IDialogueOwner owner)
 {
     if (after == DialogueStatus.InActive)
     {
         var trigger = GetComponent <TriggerBase>();
         if (trigger != null)
         {
             trigger.UnUse();
         }
     }
 }
示例#4
0
    public bool _isEnd = true; // 대화가 종료된 상태인지?

    private void DialogueUpdate(int id, List <DialoguePage> textPages, string sound, DialogueStatus status, bool isControllable)
    {
        switch (status)
        {
        case DialogueStatus.Start:
            StartDialogue(id, textPages, sound);
            _isControllable = isControllable;
            break;

        case DialogueStatus.End:
            EndDialogue();
            break;
        }
    }
示例#5
0
        protected virtual void OnCurrentDialogueStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue self, IDialogueOwner owner)
        {
            switch (after)
            {
            case DialogueStatus.InActive:
                window.Hide();
                break;

            case DialogueStatus.Active:
                window.Show();
                break;

            default:
                throw new ArgumentOutOfRangeException("after", after, null);
            }
        }
示例#6
0
        private void advanceDialogue(int option_choice)
        {
            dialogue.advanceDialogue(option_choice);
            dialogueStatus = dialogue.GetStatus();
            narrator.Text = dialogueStatus.Dialogue;
            if (dialogueStatus.Over)
            {
                foreach (var button in buttons)
                    button.Key.Visibility = Visibility.Collapsed;
                returnToNavi.Visibility = Visibility.Visible;
            }
            else
                updateButtons();

            narrator.Text = dialogueStatus.Dialogue;
        }
示例#7
0
        public DialoguePage()
        {
            if (story == null)
            {
                this.story = App.Story;
                this.hero = story.Hero;
            }

            dialogueStatus = null;
            dialogue = hero.Location.SomeoneWantsToTalk.CurrentDialogue;

            InitializeComponent();

            dialogueStatus = dialogue.GetStatus();

            //buttons = new List<Button>() { option1, option2, option3, option4, option5, option6 };
            updateButtons();

            narrator.Text = dialogueStatus.Dialogue;
        }
示例#8
0
    // Use this for initialization
    void Start()
    {
        source = gameObject.GetComponent <AudioSource>();
        // Set the sound of this object.
        Sound.SetSound(source, 0.3f);

        // Set the texts and gameobjects.
        dialogueText       = transform.GetChild(DialogueTextIndex).GetComponent <Text>();
        continueTextObject = transform.GetChild(ContinueTextIndex).gameObject;

        // Set the initial condition of the dialogue.
        displayedDialogue = new StringBuilder(SpeakerName + ": ");
        dialogueText.text = displayedDialogue.ToString();

        continueTextObject.SetActive(false);

        currentDialogueStatus = DialogueStatus.Playing;
        textDelay             = SlowTextDelay;

        OnDialogueStarted();
    }
 public GE_UI_Dia(Speaker s, DialogueStatus dS)
 {
     speaker = s;
     status  = dS;
 }
 private void OnCurrentDialogueStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue.Dialogue self, IDialogueOwner owner)
 {
     FireEvent("OnCurrentDialogueStatusChanged", after.ToString());
 }
示例#11
0
 public static void Trigger(int id, List <DialoguePage> textPages, int index, string sound = "", DialogueStatus status = DialogueStatus.Start, bool isControllable = true)
 {
     _event._id             = id;
     _event._textPages      = textPages;
     _event._index          = index;
     _event._sound          = sound;
     _event._status         = status;
     _event._isControllable = isControllable;
     EventManager.TriggerEvent(_event);
 }
示例#12
0
    // Update is called once per frame
    void Update()
    {
        switch (currentDialogueStatus)
        {
        case DialogueStatus.Playing:
            // Perform the delay.
            if (currentDelayCount < textDelay)
            {
                currentDelayCount++;
            }
            else
            {
                // Append a character to the displayed text.
                if (currentDialogueStringIndex < Dialogues[CurrentDialogueIndex].Length)
                {
                    displayedDialogue.Append(Dialogues[CurrentDialogueIndex][currentDialogueStringIndex]);
                    dialogueText.text = displayedDialogue.ToString();

                    if (textDelay == SlowTextDelay)
                    {
                        PlayDisplaySound();
                    }

                    currentDialogueStringIndex++;
                    currentDelayCount = 0;
                }
                else
                {
                    // End the display and make the dialogue slow again.
                    textDelay             = SlowTextDelay;
                    currentDialogueStatus = DialogueStatus.Ended;
                }
            }

            break;

        case DialogueStatus.Ended:
            // Set the next dialogue to be played.
            if (CurrentDialogueIndex + 1 < Dialogues.Length)
            {
                OnDialogueFinished();
                continueTextObject.SetActive(true);

                CurrentDialogueIndex++;

                displayedDialogue          = new StringBuilder(SpeakerName + ": ");
                currentDialogueStringIndex = 0;
            }
            else
            {
                OnDialogueFinished();
                OnAllDialogueFinished();

                allDialogueFinishedFlag = true;
            }

            currentDialogueStatus = DialogueStatus.Waiting;

            break;

        case DialogueStatus.Waiting:
            break;

        default:
            break;
        }

        // Check when the user clicks.
        if (Input.GetMouseButtonUp(0))
        {
            switch (currentDialogueStatus)
            {
            case DialogueStatus.Playing:
                // Make the text appear faster.
                textDelay = FastTextDelay;

                break;

            case DialogueStatus.Waiting:
                // Play the next dialogue.
                continueTextObject.SetActive(false);
                currentDialogueStatus = DialogueStatus.Playing;
                if (!allDialogueFinishedFlag)
                {
                    OnDialogueStarted();
                }

                break;

            default:
                break;
            }
        }
    }
示例#13
0
 protected virtual void DialogueOnStatusChanged(DialogueStatus before, DialogueStatus after, Devdog.QuestSystemPro.Dialogue.Dialogue self, IDialogueOwner owner)
 {
 }