Yes, but the math is fairly difficult (for someone like me anyway).
You need to know how many pixels are being taken up by that object on the scene, which means you need to measure the screenspace of each face on the object.
I’m not going to go through the math because I don’t know it, but it’s probably something similar to finding the z distance to the vertexes that make up the face, calculate that distance, scale the measurement to screenspace (this is the difficult part, probably…), compare that distance to the screen’s width/height (which is in pixels afaik).
Assuming the plane is axis aligned and parallel to the camera, you can use Camera.WorldToScreenPoint() to translate the size. Note that the build-in plane when it is scaled to (1,1,1), is 10 units on a side.
var planeScale = 10.0;
function Update () {
if (Input.GetKeyDown(KeyCode.Space)) {
var v3 = Vector3(planeScale * transform.localScale.x, planeScale * transform.localScale.y, transform.position.z);
v3 = Camera.main.WorldToScreenPoint(v3);
var v3Zero = Camera.main.WorldToScreenPoint(Vector3.zero);
v3 = v3 - v3Zero;
Debug.Log("Image screen size: " + v3.x + " x " + v3.y);
}
}
Note this gives you a fractional amount which I think you can use Mathf.RoundToInt() but may have to do a Mathf.CeilToInt() to get the exact size. Note you will get the same value even if the plane is only partially visible.
Of course, the panels factor of the panel is set to 10, but in case you would change it, your script would not be correct anymore. This way you can use it on each plane, doesn’t matter if the factor has been changed!