コード例 #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
ファイル: DialogueOwner.cs プロジェクト: tcape/stc_game
 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
ファイル: DialoguePage.xaml.cs プロジェクト: Turrino/RPS
        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
ファイル: DialoguePage.xaml.cs プロジェクト: Turrino/RPS
        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();
    }
コード例 #9
0
 public GE_UI_Dia(Speaker s, DialogueStatus dS)
 {
     speaker = s;
     status  = dS;
 }
コード例 #10
0
 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)
 {
 }