void OnTriggerExit(Collider other) { if (userStudyRunning == false) { if (other.tag == "Document") { documentText = null; foreach (Transform t in transform.GetChild(0).GetComponentInChildren <Transform>()) { t.gameObject.layer = 0; } } if (other.tag == "SaveBox") { Cardboard_Box_Behaviour box = other.GetComponent <Cardboard_Box_Behaviour>(); if (node != null) { box.outBox(); if (node.transform.tag != "SaveBox" && node.transform.tag != "SaveButton") { node.transform.position = pickedUpNodePos; box.AddNode(node.GetComponent <VisualNode>()); } } } if (other.tag == "SaveButton") { Box_SaveButton btn = other.GetComponent <Box_SaveButton>(); save_button = null; btn.ExitHighlight(); print("left save button"); } } if (other.tag == "StudyNode") { StudyNode s = other.gameObject.GetComponent <StudyNode>(); s.highlight_studynode = true; } if (other.tag == "NavigationCamera") { node = other.transform.parent; } if (node == null && other.tag != "SaveButton" && userStudyRunning == false) { node = other.transform.parent; } }
void OnTriggerEnter(Collider other) { if (userStudyRunning == false) { if (other.tag == "Document") { documentText = other.GetComponent <Document_Behaviour>().scollableText(); foreach (Transform t in transform.GetChild(0).GetComponentInChildren <Transform>()) { t.gameObject.layer = 5; } } if (other.tag == "SaveBox") { Cardboard_Box_Behaviour box = other.GetComponent <Cardboard_Box_Behaviour>(); if (node != null) { box.inBox(); } } if (other.tag == "SaveButton") { Box_SaveButton btn = other.GetComponent <Box_SaveButton>(); save_button = btn; btn.Highlight(); print("selected save button"); } } if (other.tag == "StudyNode") { StudyNode s = other.gameObject.GetComponent <StudyNode>(); s.highlight(); s.createEdges(); print("Found Study Node and Method should be called"); } if (other.tag == "NavigationCamera") { node = other.transform.parent; nodeParent = other.transform.parent.parent; } if (node == null && other.tag != "SaveButton" && userStudyRunning == false) { node = other.transform.parent; } //print(other.transform +" triggered"); }