Unity C# はオブジェクトがカメラの視点内にあるかどうかを判断します

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("画面に表示された");

おすすめ

転載: blog.csdn.net/qq_21743659/article/details/133748052