示例#1
0
    void OnTriggerExit2D(Collider2D other)
    {
        if (ignoreTrigger)
        {
            return;
        }

        if (other.tag == "Player")
        {
            door.DoorCloses();
        }
    }
示例#2
0
    //when the object stops interacting with the object
    void OnTriggerExit2D(Collider2D other)
    {
        //if the ignorTrigger is set true, exit
        if (ignoreTrigger)
        {
            return;
        }

        //if the object has the tag "Player" close the door
        if (other.tag == "Player")
        {
            door.DoorCloses();
        }
    }