void DisplayLine() { Line line = dialogue.lines[activeLineIdx]; DialogueCharacter character = line.character; if (speakerUILeft.CompareSpeaker(character)) { activeSpeakerUI = speakerUILeft; SetDialogue(speakerUILeft, speakerUIRight, line.text); } else { activeSpeakerUI = speakerUIRight; SetDialogue(speakerUIRight, speakerUILeft, line.text); } if (dialogue.lines[activeLineIdx].hasVoceOver) { voiceLineManager.PlayClip(dialogue.lines[activeLineIdx].voiceLine); totalDelay = voiceLineManager.LengthOfClip(0) + delayAfterFinishedLine; } else { totalDelay = activeSpeakerUI.AnticipatedTypingTime() + delayAfterFinishedLine; } }
private void StartConvorsation(DialogueCharacter character) { DialogueTree tree = character.GetDialogue(); tree.SetCharacters(new CharacterInfo[] { info, character.GetCharacter() }); player.PlayTree(tree); }
public void StartDialogue(DialogueCharacter character, Action OnSpecificDialogueEnded = null) { DialogueTree tree = character.GetDialogue(); tree.SetCharacters(new CharacterInfo[] { playerInfo, character.GetCharacter() }); player.PlayTree(tree, OnSpecificDialogueEnded); }
public void TalkTopeople(GameObject personToInteractWith) { // TODO talk to the person to interact with. DialogueCharacter character = personToInteractWith.GetComponent <DialogueCharacter>();//TODO choose interaction StartDialogue(character); }
private void Awake() { if (Instance == null) { Instance = this; } image = GetComponent <Image>(); rectTransform = GetComponent <RectTransform>(); }
// Use this for initialization void Start() { dialoguesTest = new LevelDialogues(); dialoguesTest = dialoguesTest.newSceneDialogue(1); DialogueCharacter fraDialogsIT = dialoguesTest.characterDialogues("Fra", dialoguesTest.dialogues, "it"); DialogueCharacter gabDialogsIT = dialoguesTest.characterDialogues("Gabri", dialoguesTest.dialogues, "it"); for (int i = 0; i < 2; i++) { Debug.Log(fraDialogsIT.name + ": " + fraDialogsIT.dialogueTexts[i].text); Debug.Log(gabDialogsIT.name + ": " + gabDialogsIT.dialogueTexts[i].text); } }
public void DisplayLine() { Line line = dialogue.lines[activeLineIdx]; DialogueCharacter character = line.character; if (speakerUILeft.CompareSpeaker(character)) { activeSpeakerUI = speakerUILeft; SetDialogue(speakerUILeft, speakerUIRight, line.text); } else { activeSpeakerUI = speakerUIRight; SetDialogue(speakerUIRight, speakerUILeft, line.text); } }
private void Update() { if (!Input.GetKeyDown(KeyCode.E)) { return; } //TODO replace with actual collider code var hits = Physics2D.CircleCastAll(transform.position, 10, transform.forward); foreach (var hit in hits) { DialogueCharacter character = hit.collider.GetComponent <DialogueCharacter>();; if (character == null) { continue; } StartConvorsation(character); } }
public DialogueCharacter characterDialogues(string characterName, List <Dialogues> dialogues, string language) { Dialogues currentDialogue = new Dialogues(); DialogueCharacter currentCharacter = new DialogueCharacter(); for (int i = 0; i < dialogues.Count; i++) { if (dialogues[i].language == language) { currentDialogue = dialogues[i]; } } for (int i = 0; i < currentDialogue.characters.Count; i++) { if (currentDialogue.characters[i].name == characterName) { currentCharacter = currentDialogue.characters[i]; } } return(currentCharacter); }
void LateUpdate() { if (activeCharacter != null) { if (Vector3.Distance(activeCharacter.transform.position, transform.position) < InteractionRadius) { return; } else { activeCharacter.SetInRange(false); activeCharacter = null; } } var dialogue = DialogueCharacter.Characters.Find(c => Vector3.Distance(c.transform.position, transform.position) < InteractionRadius); if (dialogue == null) { return; } dialogue.SetInRange(true); activeCharacter = dialogue; }
public bool CompareSpeaker(DialogueCharacter character) { return(speaker == character); }
public void SetCharacter(DialogueCharacter c) { character = c; characterSprite.sprite = c.characterSprites[0]; }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("DialogueCharacterPlayer").GetComponent <DialogueCharacter>(); }