void OnTriggerEnter(Collider other) { HHK_Role_Tags role = other.GetComponent <HHK_Role_Tags>(); if (role) { if (role.Is_Belong_Teams_Either(allowed)) { // in to this area roles.Add(role); } } // leap motion RigidFinger finger = other.GetComponentInParent <RigidFinger>(); if (finger) { //Debug.Log("finger"); role = other.GetComponentInParent <HHK_Role_Tags>(); if (role && !roles.Contains(role)) { // in to this area roles.Add(role); } } }
void OnTriggerExit(Collider other) { HHK_Role_Tags role = other.GetComponent <HHK_Role_Tags>(); if (role) { HHK_Role_Tags.TAG[] tags = { HHK_Role_Tags.TAG.Role_Player }; if (role.Is_Belong_Teams_Either(tags)) { uiPanel.gameObject.SetActive(false); } } }