コード例 #1
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        NPCForms otherNPC = collision.GetComponent <NPCForms>();

        if (otherNPC != null && otherNPC.GetForm() == currentForm)
        {
            _isTrigger = false;
        }
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        NPCForms otherNPC = collision.GetComponent <NPCForms>();

        if (otherNPC != null)
        {
            _isTrigger   = true;
            _triggerForm = otherNPC.GetForm();
        }
    }