コード例 #1
0
 public void OnTriggerExit(Collider who)
 {
     if (who.tag == "Player")
     {
         _Phase = SpeechPhase.None;
     }
 }
コード例 #2
0
    public void TransitionTextbox()
    {
        // Refade content and advance button.
        Content.Tint = new Color(0, 0, 0, 0);

        if (_DialogueIndex >= DialogueLines.Count)
        {
            // Hide the background, so that next time the user
            // speaks to an entity, the text background fades in.
            TextBackground.Tint = new Color(0, 0, 0, 0);
            Speaker.Tint        = new Color(0, 0, 0, 0);

            _DialogueIndex = _DialogueStartIndex;
            _Phase         = SpeechPhase.CanTalk;
            Content.Text   = string.Empty;
        }
        else
        {
            _Phase       = SpeechPhase.Conversation;
            Content.Text = DialogueLines[_DialogueIndex].ShownText;

            foreach (string thisMessage in DialogueLines[_DialogueIndex].Messages)
            {
                this.SendMessage(thisMessage, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
コード例 #3
0
    public void OnTriggerEnter(Collider who)
    {
        if (who.tag != "Player")
        {
            return;
        }

        _Phase = SpeechPhase.CanTalk;
    }
コード例 #4
0
    public void OnGUI()
    {
        switch (_Phase)
        {
        case SpeechPhase.CanTalk:
            GUI.skin = MapSkin;
            if (SpeechNotice.IsClicked())
            {
                _Maestro.PlaySoundEffect(ButtonSound);

                _Phase         = SpeechPhase.Conversation;
                _DialogueIndex = _DialogueStartIndex;
                TransitionTextbox();
            }
            break;

        case SpeechPhase.Conversation:
            GUI.skin = DialogueSkin;
            TextBackground.DrawMe();
            Speaker.DrawMe();
            Content.DrawMe();

            for (int i = 0; i < DialogueLines[_DialogueIndex].Buttons.Count; i++)
            {
                DialogueButton button = DialogueLines[_DialogueIndex].Buttons[i];
                if (button.Button.IsClicked())
                {
                    _Maestro.PlaySoundEffect(ButtonSound);

                    _DialogueIndex      = button.DialogueIndex;
                    _DialogueStartIndex = button.NewDialogueStartIndex;
                    TransitionTextbox();
                }
            }
            break;

        default:
            break;
        }
    }
コード例 #5
0
    public void TransitionTextbox()
    {
        // Refade content and advance button.
        Content.Tint = new Color(0,0,0,0);

        if(_DialogueIndex >= DialogueLines.Count)
        {
            // Hide the background, so that next time the user
            // speaks to an entity, the text background fades in.
            TextBackground.Tint = new Color(0,0,0,0);
            Speaker.Tint = new Color(0,0,0,0);

            _DialogueIndex = _DialogueStartIndex;
            _Phase = SpeechPhase.CanTalk;
            Content.Text = string.Empty;
        }
        else
        {
            _Phase = SpeechPhase.Conversation;
            Content.Text = DialogueLines[_DialogueIndex].ShownText;

            foreach(string thisMessage in DialogueLines[_DialogueIndex].Messages)
            {
                this.SendMessage(thisMessage, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
コード例 #6
0
 public void OnTriggerExit(Collider who)
 {
     if(who.tag == "Player")
     {
         _Phase = SpeechPhase.None;
     }
 }
コード例 #7
0
    public void OnTriggerEnter(Collider who)
    {
        if(who.tag != "Player") { return; }

        _Phase = SpeechPhase.CanTalk;
    }
コード例 #8
0
    public void OnGUI()
    {
        switch( _Phase )
        {
            case SpeechPhase.CanTalk:
                GUI.skin = MapSkin;
                if(SpeechNotice.IsClicked())
                {
                    _Maestro.PlaySoundEffect(ButtonSound);

                    _Phase = SpeechPhase.Conversation;
                    _DialogueIndex = _DialogueStartIndex;
                    TransitionTextbox();
                }
                break;

            case SpeechPhase.Conversation:
                GUI.skin = DialogueSkin;
                TextBackground.DrawMe();
                Speaker.DrawMe();
                Content.DrawMe();

                for(int i = 0; i < DialogueLines[_DialogueIndex].Buttons.Count; i++)
                {
                    DialogueButton button = DialogueLines[_DialogueIndex].Buttons[i];
                    if(button.Button.IsClicked())
                    {
                        _Maestro.PlaySoundEffect(ButtonSound);

                        _DialogueIndex = button.DialogueIndex;
                        _DialogueStartIndex = button.NewDialogueStartIndex;
                        TransitionTextbox();
                    }
                }
                break;

            default:
                break;
        }
    }