Ejemplo n.º 1
0
 public void Choose(dialogue example1, dialogue example2)
 {
     if (example1.isTalk == true)
     {
         example2.isTalk = true;
     }
 }
Ejemplo n.º 2
0
 public void showDialoguesecond(dialogue example, GameObject A)
 {
     if (example.canTalk == true && Input.GetMouseButtonDown(0))
     {
         A.GetComponent <Text>().text = example.dialoguecontent;
         example.canTalk = true;
     }
 }
Ejemplo n.º 3
0
 public void  showDialoguefirst(dialogue example, GameObject A)
 {
     if (example.canTalk == true)
     {
         A.GetComponent <Text>().text = example.dialoguecontent;
         example.isTalk = true;
     }
 }
Ejemplo n.º 4
0
 public void StartDialogue(dialogue dialogue) //when press start button
 {
     Debug.Log("Starting conversation");
     sentences.Clear();
     foreach (string sentence in dialogue.sentences)
     {
         sentences.Enqueue(sentence);
     }
     DisplayNextSentence();
 }
Ejemplo n.º 5
0
 public void startDialogue(dialogue dia)
 {
     anim.SetBool("isOpen", true);
     nameText.text = dia.name;
     sentences.Clear();
     foreach (string sentence in dia.sentences)
     {
         sentences.Enqueue(sentence);
     }
     displayNextSentence();
 }
Ejemplo n.º 6
0
    /*void Start()
     * {
     *  sentences = new Queue<string>();
     * }*/

    public void initializeConversation(dialogue dg)
    {
        dialogueBox.SetActive(true);

        sentences.Clear();

        foreach (dialogue.Info info in dg.dialogueInfo)
        {
            sentences.Enqueue(info);
        }

        dequeueConversation();
    }
Ejemplo n.º 7
0
    public void startDialogue(dialogue dialogue) // shows dialogue on the text UI
    {
        dialogueBox.enabled  = true;             //will enable the text UI show that it is now visible as well as clear any previous text
        dialogueText.enabled = true;

        sentences.Clear();

        foreach (string sentence in dialogue.sentences)
        {
            sentences.Enqueue(sentence);
        }
        DisplayNextSentence();
    }
Ejemplo n.º 8
0
    public void startDialogue(dialogue dialogue) //begins the dialogue
    {
        dialogueBox.enabled  = true;             //box and text can now be seen in the gameplay.
        dialogueText.enabled = true;

        sentences.Clear();

        foreach (string sentence in dialogue.sentences)//will put all of the sentences from the dialogue into the queue
        {
            sentences.Enqueue(sentence);
        }
        DisplayNextSentence();
    }
Ejemplo n.º 9
0
    public void startDialogue(dialogue dialogue)
    {
        animator.SetBool("isOpen", true);
        nameText.text = dialogue.name;
        Debug.Log("convo");
        sentences.Clear();

        foreach (string sentence in dialogue.sentences)
        {
            sentences.Enqueue(sentence);
        }

        displayNextSentence();
    }
Ejemplo n.º 10
0
    public void startDialogue(dialogue d)
    {
        NameText.text = d.name;
        Debug.Log(d.name);
        Debug.Log(d.sentence[0]);

        sentence.Clear();
        foreach (string sente in d.sentence)
        {
            sentence.Enqueue(sente);
        }

        displayNextSentence();
    }
Ejemplo n.º 11
0
 public void StartDialogue(dialogue dialogue) //when scene starts
 {
     Prefs = FindObjectOfType <playerprefs>();
     Prefs.resetPref();
     Debug.Log("resetPref called");
     Debug.Log(PlayerPrefs.GetInt("Magicrocks"));
     // continueButton.gameObject.SetActive(true);
     sentences.Clear();
     Debug.Log("Starting conversation");
     foreach (string sentence in dialogue.sentences)
     {
         sentences.Enqueue(sentence);
     }
     DisplayNextSentence();
 }
Ejemplo n.º 12
0
    public void StartDialogue(dialogue text)
    {
        //Debug.Log("Starting Conversation with" + text.name);

        nameText.text = text.name;

        sentences.Clear();

        panel.SetActive(true);

        foreach (string sentence in text.sentences)
        {
            sentences.Enqueue(sentence);
        }

        DisplayNextSentence();
    }
Ejemplo n.º 13
0
    public bool CheckInteraction()
    {
        bool isInteract;

        Collider2D[] collidersHit = Physics2D.OverlapBoxAll(collider2D.bounds.center, collider2D.size, 0f, layerToCheck);

        isInteract = collidersHit != null;

        for (int i = 0; i < collidersHit.Length; i++)
        {
            IInteractive interactive = collidersHit[i].GetComponent <IInteractive>();

            if (collidersHit[i].CompareTag("Item"))
            {
                WorldItem item = collidersHit[i].GetComponent <WorldItem>();
                item.PickUp(ref inventory);
                break;
            }
            else if (interactive.ToMonoBehaviour() != null && interactive.CanInteract(null))
            {
                interactive.Interact(null);
                break;
            }
            else if (collidersHit[i].CompareTag("Merchant"))
            {
                MerchantWorld merchant = collidersHit[i].GetComponentInParent <MerchantWorld>();
                merchant.Interact();

                break;
            }
            else if (collidersHit[i].CompareTag("EndMapEvent"))
            {
                EventEndScene nextLevel = collidersHit[i].GetComponent <EventEndScene>();
                nextLevel.Activate();
                break;
            }
            else if (collidersHit[i].CompareTag("WhaleDialogue"))
            {
                dialogue dialogue = collidersHit[i].GetComponent <dialogue>();
                dialogue.InitDialog();
                break;
            }
        }

        return(isInteract);
    }
Ejemplo n.º 14
0
    public void StartDialogue(dialogue dialogue)
    {
        //Debug.Log("Start conv with " + dialogue.name);

        animator.SetBool("IsOpen", true);

        nameText.text = dialogue.name;

        sentences.Clear();

        foreach (string sentence in dialogue.sentences)
        {
            sentences.Enqueue(sentence);
        }

        DisplayNextSentence();
    }
Ejemplo n.º 15
0
    // Update is called once per frame
    public void StartDialogue(dialogue dial)
    {
        animator.SetBool("IsOpen", true);
        //sm.ispaused = true;
        StartCoroutine(PauseDelay());


        //Debug.Log("Starting Conversation with " + dial.name);
        nameText.text = dial.name;
        sentences.Clear();

        foreach (string sentence in dial.sentences)
        {
            sentences.Enqueue(sentence);
        }

        DisplayNextSentence();
    }
Ejemplo n.º 16
0
 private void Awake()
 {
     this.GetComponentInChildren <Text>().text = "New Game";
 }
Ejemplo n.º 17
0
 private void Start()
 {
     player = FindObjectOfType <PlayerController>();
     dial   = FindObjectOfType <dialogue>();
 }
Ejemplo n.º 18
0
 public void Awake()
 {
     instance = this;
 }