自用,判断物体是否在屏幕中

void OnBecameVisible() 
{
    Debug.Log(this.name.ToString()+"这个物体出现在屏幕里面了");
}

//物体离开屏幕
void OnBecameInvisible()
{
   Debug.Log(this.name.ToString() + "这个物体离开屏幕里面了");
}

猜你喜欢

转载自blog.csdn.net/qq_42591144/article/details/87865626
今日推荐