unity 判断一个trans在不在sceen内

  

public bool IsOutScreen(Transform fTrans)
{
Vector3 screenpos = API.Camera.MainCamera.WorldToScreenPoint(fTrans.position);

if (screenpos.x > Screen.width || screenpos.x < 0 || screenpos.y > Screen.height || screenpos.y < 0)
{
return true;
}
return false;
}

 

 

 

此方式可以判断  。

 

还有什么 render active可以。不过需要是mesh vertex的

posted @ 2018-06-28 19:22  sun_dust_shadow  阅读(216)  评论(0编辑  收藏  举报