Пример #1
0
    public void ShowDialogueOptions(NPC npc)
    {
        PlayerMovement.cantMove = true;
        continueArrow.SetActive(false);
        DestroyAllOptions();
        CurrentNPC = npc;
        dialoguePanel.SetActive(true);
        dialogueText.gameObject.SetActive(false);
        optionSelectPanel.SetActive(true);

        foreach (Quest quest in npc.Quests)
        {
            DialogueSystemOptionObject optionObject = Instantiate(dialogueSystemOptionObjectPrefab, optionSelectPanel.transform);
            optionObject.UpdateText(quest);
        }
        //foreach (DialogueOption option in npc.dialogueOptions)
        //{
        //    DialogueSystemOptionObject optionObject = Instantiate(dialogueSystemOptionObjectPrefab, optionSelectPanel.transform);
        //    optionObject.option = option;
        //    optionObject.transform.localScale = new Vector3(1, 1, 1);
        //    optionObject.UpdateText();
        //}
        // talk dialogue option
        DialogueSystemOptionObject talkDialogue = Instantiate(dialogueSystemOptionObjectPrefab, optionSelectPanel.transform);

        talkDialogue.SetAsTalkOption();
        talkDialogue.transform.localScale = new Vector3(1, 1, 1);
        // exit dialogue option
        DialogueSystemOptionObject exitDialogue = Instantiate(dialogueSystemOptionObjectPrefab, optionSelectPanel.transform);

        exitDialogue.SetAsExitOption();
        exitDialogue.transform.localScale = new Vector3(1, 1, 1);
        optionController.StartOptionSelect();
    }
Пример #2
0
    }                                   // show a quest at last dialouge
    //int questID;

    void Start()
    {
        continueArrow = dialoguePanel.transform.Find("Continue").gameObject;
        dialogueSystemOptionObjectPrefab = Resources.Load <DialogueSystemOptionObject>("Prefabs/UI/Dialogue Panel/Option Select");
        optionSelectPanel = dialoguePanel.transform.Find("Option Selection Panel").gameObject;
        dialogueText      = dialoguePanel.transform.Find("Dialogue Text").GetComponent <Text>();
        nameText          = dialoguePanel.transform.Find("NPC Name").GetComponentInChildren <Text>();
        dialoguePanel.SetActive(false);
        Instance         = dialoguePanel.GetComponent <DialogueSystem>();
        optionController = GetComponent <DialogueSystemOptionSelectController>();
    }