//Called from outside the class to get a conversation public static SentConv GetConv(string ConvKey) { if (!started) { Start(); } //List<sent> bbb = new List<sent>(); SentConv bbb = new SentConv(); foreach (sent s in sayList) { if (s.consays == ConvKey) { bbb.Add(s); } } foreach (conv c in conlist) { if (c.consays == ConvKey) { bbb.canMove = c.canMove; //Add next property break; } } return(bbb); }
public void StartDialogue(SentConv Sentences, GameObject speaker) { isTalking = true; var diaboxes = GameObject.FindGameObjectsWithTag("DialogueCanvas"); if (diaboxes.Length == 0) { float higher = speaker.GetComponent <NPC>().bubbleHigher; Vector3 bubblePos = new Vector3(speaker.transform.position.x, speaker.transform.position.y + higher, speaker.transform.position.z); dcp = Instantiate(DialogueCanvasPrefab, bubblePos, speaker.transform.rotation); dcp.GetComponent <DialogueManager>().StartDialogue(Sentences, speaker); } }
public void StartDialogue(SentConv SentList, GameObject speaker) { previousSpeaker = speaker; //npc = previousSpeaker.GetComponent<NPC>(); animator.SetBool("IsOpen", true); nameText.text = speaker.GetComponent <NPC>().npcName; nameText.color = speaker.GetComponent <NPC>().nameColor; sentences.Clear(); foreach (sent s in SentList) { //sentences.Enqueue(s.whatsays); sentences.Enqueue(s); } DisplayNextSentence(); }
public void TriggerDialogue() { SentConv s = Lang.GetConv(dialogue); //if(s.canMove == false) //{ // var chars = GameObject.FindGameObjectsWithTag("character"); // foreach(GameObject c in chars) // { // c.GetComponent<Animator>().SetFloat("speed", 0); // c.GetComponent<Animator>().SetBool("isJumping", false); // } //} FindObjectOfType <GlobalDialogueManager>().StartDialogue(s, GameObject.Find("Adam")); Destroy(gameObject); }