What's an effective method for activating and deactivating gameobjects not visible to the camera?

I’m making a 2D platformer and I was wondering what method would be effective in enhancing performance by selectively activating and deactivating gameobjects within the camera’s view and out of the camera’s view. There are 2 methods that seem viable at the moment.

  1. I was reading in this thread to create a giant collider around the player and activate objects that go within reach of the collider.

http://forum.unity3d.com/threads/disable-objects-far-away-from-player-to-make-performance-better.124065/

This would only make sense if you were activating certain components of a game object such as a script or a collider, but it wouldn’t work if the entire gameobject was inactive. If the gameobject was initially set to inactive ‘OnTriggerEnter2D’ wouldn’t fire, hence this method is effective for parts of gameobjects.

  1. Another method was this:

where you partition your game world into small parts and selectively activate all the objects present within that specific part of the game world. This seems like a decent strategy but incurs the overhead of creating more gameobjects in memory and probably more colliders to detect entering and exiting areas.

My ideal solution would be activating gameobjects that are initially inactive and the 2nd solution seems like the best solution so far. Would anyone have any suggestions or recommendations on any alternatives?

void OnBecameInvisible() & void OnBecameVisible()

see the doc click me

Yea Id stick to:

void OnBecameInvisible()
    {
        Destroy(gameObject);
    }

This will grab any game object that find themselves outside of the cameras visible area and simply destroy them. Probably the easiest way to solve that issue.

Please note that when debugging this in scene view the object will remain available as long as you can see it even in scene view camera.