void CheckMouseClick() { if (Input.GetMouseButtonDown(0)) { RaycastHit hitInfo = new RaycastHit(); bool hit = Physics.Raycast(MainCamera.ScreenPointToRay(Input.mousePosition), out hitInfo, Mathf.Infinity, 1); if (hit && !EventSystem.current.IsPointerOverGameObject()) { MyMesh.SelectVertex(hitInfo.transform.gameObject); } else { if (axis) { DestroyImmediate(axis.gameObject); } } } }