|
I can't extend Camera to override (or hide) the fov property to add a change notification mechanism because if I do I then can't attach it to a GameObject because it "doesn't extend MonoBehaviour" (Camera extends Behaviour). Is polling camera.fov in one of my scripts methods the only way I can monitor it for changes? Is there some other pattern people use to watch variables (in classes like Camera which you can't make any changes to) for changes?
(comments are locked)
|

I don't have an answer for you, but it does seem like polling might be your best bet here. Maybe someone else will have a better suggestion though.
I've gone with polling for the moment, the only other way I came up with was to require anyone using the component to change all there camera.fov references in the project to a property or method of my component. Which is horribly bad design and would be very error prone.