Vector3 pos = Camera.main.WorldToScreenPoint(transform.position); //Get the position of the current UI on the screen
//Judge the relationship between the current position and screen coordinates
if ((pos.z <0) || (pos.x <0) || (pos.x > Screen.width) || (pos.y <0) || (pos.y > Screen.height))
Debug.Log("Disappeared in the screen");
else
Debug.Log("Displayed in the screen");