Inheritance: UnityEngine.MonoBehaviour
Beispiel #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Debug.Log("Colliding with npc");

        if (collision.tag == "NPC" || collision.tag == "PickUp")
        {
            //Debug.Log("Colliding with npc");

            interaction_bubble.SetActive(true);

            if (collision.tag == "PickUp")
            {
                collided_pick_up = collision.GetComponent <PickUp>();
            }
            else
            {
                inside_npc_radius     = true;
                collided_npc          = collision.gameObject.GetComponent <Yarn.Unity.Example.NPC>();
                current_npc_startNode = collided_npc.talkToNode;
            }



            //collided_npc.GivePlayerItem();
        }
    }
Beispiel #2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "NPC" || collision.tag == "PickUp")
     {
         interaction_bubble.SetActive(false);
         inside_npc_radius     = false;
         current_npc_startNode = "";
         collided_npc          = null;
         collided_pick_up      = null;
     }
 }