public void OnTriggerExit(Collider who) { if (who.tag == "Player") { _Phase = SpeechPhase.None; } }
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); } } }
public void OnTriggerEnter(Collider who) { if (who.tag != "Player") { return; } _Phase = SpeechPhase.CanTalk; }
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; } }
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); } } }
public void OnTriggerExit(Collider who) { if(who.tag == "Player") { _Phase = SpeechPhase.None; } }
public void OnTriggerEnter(Collider who) { if(who.tag != "Player") { return; } _Phase = SpeechPhase.CanTalk; }
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; } }