void CreateCircle()
{
float offsetX, offsetY;
offsetX = Input.mousePosition.x;
offsetY = Input.mousePosition.y;
Vector3 pos = Camera.main.WorldToScreenPoint(worldPos);
pos.z = 0f;
Vector3 pointPos = new Vector3(pos.x + offsetX, pos.y + offsetY, 0);
Vector3 pos2 = UICamera.currentCamera.ScreenToWorldPoint(pointPos);
GameObject pointGo = NGUITools.AddChild(go, pointPre);
pointGo.transform.position = pos2;
}
if(Input.GetMouseButtonDown(0))
{
//if (UICamera.hoveredObject != null)
//{
// print("点到NGUI");
//}else
//{
// print("touch1!!!!!!!!!!!!!!!!!");
// //if (ControlSelf._instance.isexisted) return;
// if (CheckPointExist()) return;
// CreateCircle();
//}
Ray ray = UICamera.mainCamera.ScreenPointToRay(Input.mousePosition);// 向屏幕发射线
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 200))//射线的碰撞检测
{
print("点到NGUI");
}
else
{
print("touch1!!!!!!!!!!!!!!!!!");
//if (ControlSelf._instance.isexisted) return;
if (CheckPointExist()) return;
CreateCircle();
}