Vector3 pos = Camera.main.WorldToScreenPoint(transform.position); //取得当前UI在屏幕当中的位置
//判断当前的位置 与屏幕坐标的关系
if ((pos.z <0) || (pos.x <0) || (pos.x > Screen.width) || (pos.y <0) || (pos.y > Screen.height))
Debug.Log("消失在屏幕中");
else
Debug.Log("显示在屏幕中");