void OnTriggerExit(Collider col) { if (col.tag == "ComputerMonitor" || col.tag == "NPC-Creature" || col.tag == "NPC-Scientist" || col.tag == "PickUpObject") { if (col.tag == "ComputerMonitor") { computerAvailable = false; } else if (col.tag == "NPC-Scientist") { NPCSAvailable = false; } else if (col.tag == "NPC-Creature") { if (col.gameObject.GetComponent <EmoTankBlackBox>() != null || currentTargetEmotion != null) { currentTargetEmotion = null; } NPCCAvailable = false; } else if (col.tag == "PickUpObject") { PickUpObject = false; } ActionPrompt.SetActive(false); } }
void OnTriggerEnter(Collider col) { Debug.Log("The tag of this object is: " + col.tag); if (col.tag == "PickUpObject") { PickUpObject = true; objectInMyHand = col.GetComponent <PickableObject>(); ActionPrompt.SetActive(true); } else if (col.tag == null) { Debug.Log("There is no tag associated"); } /*else if (col.tag == "Untagged") * { * Debug.Log(""); * }*/ else if (col.tag == "ComputerMoniteur") { computerAvailable = true; ActionPrompt.SetActive(true); } else if (col.tag == "NPC-Creature") { if (col.gameObject.GetComponent <EmoTankBlackBox>() != null) { currentTargetEmotion = col.gameObject.GetComponent <EmoTankBlackBox>(); } NPCCAvailable = true; ActionPrompt.SetActive(true); } else if (col.tag == "NPC-Scientist") { NPCSAvailable = true; ActionPrompt.SetActive(true); } /*else if (col.tag == "") -------------------------IN CASE WE NEED MORE * { * Debug.Log(""); * }*/ currentTalkingTarget = col.name; }