Beispiel #1
0
    public void ShowResponse(int i, bool showGeneralresponse, bool showUniqueResponse, DialogueNavigation dialogueScript)
    {
        string sentence = null;

        if (!showGeneralresponse && !showUniqueResponse)
        {
            int rnd;
            switch (i)
            {
            case 0:
                rnd      = Random.Range(0, greetingResponse.Count);
                sentence = greetingResponse[rnd];
                break;

            case 1:
                rnd      = Random.Range(0, rumourResponse.Count);
                sentence = rumourResponse[rnd];
                break;

            default:
                rnd      = Random.Range(0, farewellResponse.Count);
                sentence = farewellResponse[rnd];
                break;
            }
        }
        else if (showGeneralresponse)
        {
            sentence = generalUniqueResponse[i];
        }
        else if (showUniqueResponse)
        {
            if (dictionaryE.Events["dated"] && specificUniqueResponse[i].Contains("30"))
            {
                sentence = specificUniqueResponse[i + 1];
            }
            else
            {
                sentence = specificUniqueResponse[i];
            }
        }

        if (sentence != null)
        {
            TextAppearanceManager          = listener.GetComponent <TextAppearanceManager>();
            TextAppearanceManager.Text     = listener.GetComponent <Text>();
            TextAppearanceManager.Sentence = sentence.ToCharArray();

            if (dialogueScript != null)
            {
                TextAppearanceManager.DialogueScript = dialogueScript;
            }

            TextAppearanceManager.enabled = true;

            ClueSearch(sentence);
        }

        //LLAMAMOS AL SCRIPT QUE ACTIVA UN EVENTO SEGÚN LO QUE HAYA RESPONDIDO EL NPC
        eventTrigger.SentenceEventTrigger(sentence, listener.transform.parent.parent.name);
    }
Beispiel #2
0
    //APARECEN LAS LETRAS UNA A UNA
    public void AppearLine()
    {
        talking = true;
        TextAppearanceManager textAppears = line.GetComponent <TextAppearanceManager>();

        textAppears.Text           = line.GetComponent <Text>();
        textAppears.Sentence       = dialogueLines[dialogueLineIndex].text.ToCharArray();
        textAppears.enabled        = true;
        textAppears.DialogueScript = GetComponent <DialogueNavigation>();
    }
Beispiel #3
0
 void Start()
 {
     majorelText.SetActive(true);
     narratorSentences = loadXmlScript.NarratorClass;
     text = GetComponent <Text>();
     textAppearanceManager = GetComponent <TextAppearanceManager>();
     i    = 0;
     anim = background.GetComponent <Animator>();
     majorelTextAppearanceManager = majorelText.GetComponent <TextAppearanceManager>();
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     text = GetComponent <Text>();
     i    = 0;
     textAppearanceManager = GetComponent <TextAppearanceManager>();
     canContinue           = true;
     narratorSentences     = loadXmlScript.NarratorClass;
     anim          = majorelCliff.GetComponent <Animator>();
     fadeoutScript = fade.GetComponent <FadeOutController>();
     fadeInScript  = fade.GetComponent <FadeInController>();
 }
Beispiel #5
0
    void Update()
    {
        if (Npc != null)
        {
            float horizontal = Input.GetAxisRaw("Horizontal");
            float vertical   = Input.GetAxisRaw("Vertical");

            if ((vertical != 0 || horizontal != 0 || Input.anyKeyDown) && Npc.transform.GetChild(1).gameObject.activeSelf)
            {
                TextAppearanceManager textAppearance = Npc.transform.GetChild(1).gameObject.transform.GetComponentInChildren <TextAppearanceManager>();

                //textAppearance.ResetTextAppeareance(Npc.transform.GetChild(1).gameObject.GetComponentInChildren<Text>());
                Npc.transform.GetChild(1).gameObject.SetActive(false);
                actionT.IsDialogueOn = false;
                //textAppearance.IsActive = true;
                //actionTrigger.SetActive(true);

                if (vertical != 0 || horizontal != 0)
                {
                    actionT.OnOffAnimator(false);
                }
            }
        }
    }
Beispiel #6
0
 public void HideResponse()
 {
     TextAppearanceManager           = listener.GetComponent <TextAppearanceManager>();
     TextAppearanceManager.Text      = listener.GetComponent <Text>();
     TextAppearanceManager.Text.text = "";
 }
Beispiel #7
0
 private void Awake()
 {
     textAppearanceManager = GetComponent <TextAppearanceManager>();
     text = GetComponent <Text>();
 }