//PointerInputEventData pointerInputEventData = FocusManager.Instance.GetSpecificPointerEventData(pointingSource);
//GameObject obj = pointerInputEventData.selectedObject;
//if (Input.GetButtonDown("Fire1"))
if (Input.GetMouseButtonDown(0))
{
Debug.Log("click");
GameObject obj;
RaycastHit hitInfo;
if (Physics.Raycast(
Camera.main.transform.position,
Camera.main.transform.forward,
out hitInfo,
20.0f,
Physics.DefaultRaycastLayers))
{
obj = hitInfo.collider.gameObject;
obj = obj.transform.parent.gameObject;
// If the Raycast has succeeded and hit a hologram
// hitInfo's point represents the position being gazed at
// hitInfo's collider GameObject represents the hologram being gazed at
txt.text = obj.name + " : InputDown";
Debug.Log(obj.transform.parent.name);
if (obj.layer == 9)
{
// is and object -> shoudld check if correct
if (obj.name == objectToFindName)
{
Correct();
}
else
{
Wrong();
}
}
else if (obj.layer == 10)
{
// object from scene selector menu
GoToNextScene();
}
else
{
// is a menu option -> should show other menu
testManager.GetComponent<FileLog>().Click(3);
//hide curent menu
currentMenu.SetActive(false);
//show next menu
foreach (GameObject m in menus)
{
if (m.name == obj.name)
{
m.SetActive(true);
currentMenu = m;
break;
}
}
}
}
}
}
private void Update()
{