コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     agent        = GetComponent <NavMeshAgent>();
     playerObject = GameObject.Find("MainPlayer");
     giveQuest    = GameObject.Find("_UI/Canvas");
     takeQuest    = giveQuest.GetComponent <GiveQuest>();
 }
コード例 #2
0
    public void StartDialogue(Dialogue dialogue, GameObject talkingNPC)
    {
        pause.SetActive(false);
        reset.SetActive(false);
        rl.enabled            = false;
        laikaCollider.enabled = false;
        gq     = talkingNPC.GetComponent <GiveQuest>();
        intro  = talkingNPC.GetComponent <IntroCutsceneDialogue>();
        q2d    = talkingNPC.GetComponent <Quest_Dialogue_Logic>();
        mechD  = talkingNPC.GetComponent <MechanicDialogueUpdater>();
        jailed = talkingNPC.GetComponent <JailedNPCDialogue>();

        talking = true;
        animator.gameObject.GetComponent <Animator>().SetBool("IsOpen", true);
        nameText.text = dialogue.name;
        if (sentences != null)
        {
            sentences.Clear();
        }

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

        DisplayNextSentence();
    }
コード例 #3
0
    void Start()
    {
        canvas = GameObject.Find("_UI/Canvas");
        GiveQuest      newCanvas  = canvas.GetComponent <GiveQuest>();
        MainQuestGiver mainCanvas = canvas.GetComponent <MainQuestGiver>();

        mainQuestObject = mainCanvas;
        questObject     = newCanvas;
    }
コード例 #4
0
    void Start()
    {
        NPC     = this.gameObject;
        gq      = GetComponent <GiveQuest>();
        player  = GameObject.Find("Player");
        talktip = player.transform.GetChild(5).GetChild(2).gameObject;

        TalkDistance = 2;
        d            = Vector3.Distance(player.transform.position, NPC.transform.position);
        originalRot  = transform.rotation;
        sentencesNum = dialogue.sentences.Length;

        List <Quest> qs    = player.GetComponent <QuestHolder>().quests;
        string       title = gq.quest.title;

        for (int i = 0; i < qs.Count; i++)
        {
            if (title.Equals(qs[i].title))
            {
                UpdateQuest(qs[i], i);
            }
        }
    }