コード例 #1
0
    // -----------------------------------------------------------------------------------
    // Show
    // -----------------------------------------------------------------------------------
    public void Show(Npc _npc)
    {
        Player player = Player.localPlayer;

        if (!player)
        {
            return;
        }

        npc          = _npc;
        requirements = npc.npcRestrictions;

        for (int i = 0; i < content.childCount; ++i)
        {
            Destroy(content.GetChild(i).gameObject);
        }

        updateTextbox();

        interactButton.interactable = requirements.checkRequirements(player);

        interactButton.onClick.SetListener(() =>
        {
            npc.ConfirmAccess();
            Hide();
        });

        panel.SetActive(true);
    }