Check out example codes for "how to fix on GetMouseButtonDown activating UI unity". It will help you in understanding the concepts better.
Code Example 1
using UnityEngine.EventSystems;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
// This line prevents the Code from activating UI
if (EventSystem.current.IsPointerOverGameObject())
return;
// Put your code here
}
}
Learn ReactJs, React Native from akashmittal.com