How to reinstate a disabled object when becomes visible?

I know that sounds odd as a deactivated gameObject will never be visible… but I have the following script that works great for deactivating my offscreen trees… but how do I go about getting them to activate again? Obviously this code won’t work as once deactivated, they can never become visible again. I also tried with renderer.enabled etc but same issues:

function OnBecameVisible()
// = true;
 gameObject.renderer.enabled = true;

function OnBecameInvisible()
// = false;
 gameObject.renderer.enabled = false;

These is no need to use OnBecameVisible or OnBecameInvisible for this such thing. Unity already culls renderers when out of the camera frustum. So it’s already removing the draw calls and triangles from the scene when your not looking at it. There is really no point to this.

But if you want more accurate results you should use the occlusion system which does a much better job than the giant frustum most people are running.