NodeExists() public method

public NodeExists ( string nodeName ) : bool
nodeName string
return bool
Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (m_npcLayerMask == (m_npcLayerMask | (1 << other.gameObject.layer)))
        {
            TalkableNPC npc = other.GetComponent <TalkableNPC>();
            if (npc == null)
            {
                Debug.LogError("Entered trigger of chracter who is not NPC.");
                return;
            }

            if (m_currTalkableNPC != null)
            {
                Debug.LogWarning("Overriding current NPC to talk to.");
                m_currTalkableNPC.SetInteractable(false);
            }

            string dialogueNodeName = npc.DialogueNodeName;

            // Check NodeExists
            if (!m_dialogueRunner.NodeExists(dialogueNodeName))
            {
                Debug.LogError(string.Format(
                                   "Dialogue node with name ({0}) does not exist.", dialogueNodeName));
                m_currTalkableNPC = null;
                return;
            }

            m_currTalkableNPC = npc;
            m_currTalkableNPC.SetInteractable(true);
        }
    }
Ejemplo n.º 2
0
 public void OnMouseUp()
 {
     if (dr.NodeExists(YarnSummaryNode) && !dr.isDialogueRunning)
     {
         dr.StartDialogue(YarnSummaryNode);
     }
 }