private void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.GetComponent <PlayerController>() && speech.currentLine == "")
        {
            speech.Speak("Want some gold?");
        }
        var otherSpeech = collider.GetComponentInParent <SpeechController>();

        if (otherSpeech)
        {
            if (otherSpeech.currentLine == "yes")
            {
                if (!alreadyGiven)
                {
                    gm.pc.ChangeGold(2);
                    alreadyGiven = true;
                }
                else
                {
                    speech.Speak("Wait but i just gave you");
                    speech.Speak("Thief!");
                }
            }
        }
    }
Beispiel #2
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.GetComponent <PlayerController>() && speech.currentLine == "")
        {
            speech.Speak("Hi!");
            speech.Speak("You should check out my shop!");
            speech.Speak("Just let me know, like saying `shop`");
        }
        var otherSpeech = collider.GetComponentInParent <SpeechController>();

        if (otherSpeech)
        {
            if (otherSpeech.currentLine == "shop")
            {
                gm.OpenShop();
            }
        }
    }
 private void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.GetComponent <PlayerController>() && speech.currentLine == "")
     {
         foreach (string s in informations)
         {
             speech.Speak(s);
         }
     }
 }
 private void SayError(string err)
 {
     speech.Speak("<color=red>" + err + "</color>");
 }