Obj가 Box Collider에 적용중일때
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("CompletionObject"))
{
completionPopup.ShowPopup();
Debug.Log("CompletionObject trigger detected.");
}
}
Obj가 Mesh Collider에 적용중일때
private void OnControllerColliderHit(ControllerColliderHit hit)
{
if (!isCollided && hit.gameObject.CompareTag("TriggerObject"))
{
collidedObject = hit.gameObject;
QuizData quiz = new QuizData("Is the Earth round?", true);
popupController.ShowPopup(collidedObject,quiz);
isCollided = true;
}
}