void Start(){
        Rect screenRect  = new Rect(0, 0, Screen.width, Screen.Height); 
    }
    
    void Update{
        Vector3 screenPos = targetCamera.WorldToScreenPoint(objTrans.position);
        if(!screenRect.Contains(screenPos)){
            //do what you want
            Debug.log("Obj has gone out of screen...");
        }
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-10-31
  • 2021-09-26
  • 2022-02-05
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-07-04
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案