Exemplo n.º 1
0
 public void RestartNPC()
 {
     if (npc.ActivateDialogue() != null)
     {
         GameManager.dialogueManager.SetNPC(npc);
         GameManager.playerMovement.canInteract  = true;
         GameManager.playerMovement.interactable = this;
     }
     else
     {
         GameManager.dialogueManager.SetNPC(null);
         GameManager.playerMovement.canInteract  = false;
         GameManager.playerMovement.interactable = null;
         GameManager.playerMovement.input.Player.Enable();
     }
 }
    public bool SetNPC(NPC npc)
    {
        if (npc == null)
        {
            activeDialogue = null;
            return(true);
        }

        this.npc       = npc;
        activeDialogue = npc.ActivateDialogue();
        if (activeDialogue == null)
        {
            return(false);
        }
        npcName.text        = npc.name;
        npcDescription.text = npc.description;
        selectedOption      = false;
        dialogueText.text   = "";
        return(true);
    }
    public void Show()
    {
        activeDialogue         = npc.ActivateDialogue();
        selectedOption         = false;
        optionsAreShown        = false;
        optionsPaneGroup.alpha = 0;
        dialogueText.text      = "";
        foreach (Transform transform in optionsPane.transform)
        {
            Destroy(transform.gameObject);
        }

        activeDialogue.ResetLines();
        if (MovePosition(DialogueManagerPosition.ShownPosition))
        {
            // GameManager.playerMovement.isInUI = true;
            if (activeDialogue != null && activeDialogue.HasNextLine() && !isAnimatingText)
            {
                animationRoutine = StartCoroutine(AnimateText(activeDialogue.GetNextLine(), 0.5f));
            }
        }
    }