Example #1
0
    private void OnTriggerExit(Collider other)
    {
        if (m_selectedTrap != null)
        {
            m_selectedTrap.HighlightTrap(false);
        }

        m_selectedTrap = null;
    }
Example #2
0
    private void OnTriggerStay(Collider other)
    {
        if (m_selectedTrap == null)
        {
            GameObject obj = other.gameObject;

            if (LayerMask.LayerToName(obj.layer) == "Payloads")
            {
                m_selectedTrap = obj.transform.parent.GetComponent <Trap>();
                m_selectedTrap.HighlightTrap(true);
            }
        }
    }