I need to be able to look at a tree on a terrain and be able to get what type of tree it is (say, an Oak vs. a Pine). A ray cast from the camera seems to collide with the trees just fine, but only returns "terrain" as the collider touched. I'm not too concerned with the individual tree, merely its type, and the scene itself is static, so the terrain won't change during runtime right now.
In a nutshell, I need the get the specific treePrototype from a ray cast collision on the terrain.
I know the terrain API is murky, but is there a good way to do this? The scene itself has thousands of trees, so looping through every single treeinstance to find the tree I'm looking at isn't really feasible, nor is placing colliders by hand as separate objects.
It seems like I should be able to find out the original treePrototype prefab quickly if I'm raycasting to its capsule collider, but perhaps not - another possibility would be to look at texture data, if the terrain stores the tree data there along with ground info. Any suggestions?