We're working on a project that moves the camera instead of the game objects. Between Unity's Camera class and the NGUIMath/NGUITools there's lots of functions for moving game objects to be within the bounds of a camera (FitOnScreen, etc). However, for our game, all of the game objects will be stationary, so what we need is something that isn't telling us where to put an object so that it's at a certain point within the camera's view, but we want to move the camera to the exact spot to get the object where we want it.
For example, it's easy enough to move a widget to the exact edge of the screen using stuff like ViewpointPorttoWorldPoint(), but is there a way to calculate where we'd need to put the camera to get the widget at the exact edge of the screen? I've been looking into bounds calculations but I'm still missing something.
BTW we're using a multiple camera setup, camera in camera sort of thing, so we'd need to be able to do this with any camera, not just one that's bounded by the screen.
Thanks! Let me know if this needs any clarification.
-Mo