Check out example codes for "unity if gameobject is clicked". It will help you in understanding the concepts better.
Code Example 1
void OnMouseDown()
{
// Do something
}
// Works only if the gameobject have a collider
Code Example 2
void Update()
{
// Check for mouse input
if (Input.GetMouseButton(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
// Casts the ray and get the first game object hit
Physics.Raycast(ray, out hit);
Debug.Log("This hit at " + hit.point );
}
}
Learn ReactJs, React Native from akashmittal.com