Example #1
0
    void OnTriggerExit(Collider other)
    {
        GameObject target;

        if (other.tag == "Player")
        {
            if (other.gameObject == WhoIsTargetingMe)
            {
                WhoIsTargetingMe = null;
            }
            playerInZone = false;
            if (parent.diagnosed)
            {
                textBoxManager.DisableTextBox();
            }
            else
            {
                textBoxManager.DisableTextBoxNotDiagnozed();
            }
        }
        else if (other.tag == "NPC" && other.gameObject == WhoIsTargetingMe)
        {
            target = other.GetComponent <NPC>().getTarget();
            if (target == transform.parent.gameObject)
            {
                WhoIsTargetingMe = null;
                npcInZone        = false;
            }
        }
    }