x


Watching for Camera FOV changes.

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?

more ▼

asked Sep 04 '10 at 02:54 AM

Eagle32 gravatar image

Eagle32
452 2 6 17

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.

Sep 04 '10 at 05:50 AM Jesse Anders

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.

Sep 08 '10 at 04:47 AM Eagle32
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3128
x850
x389

asked: Sep 04 '10 at 02:54 AM

Seen: 1179 times

Last Updated: Sep 04 '10 at 02:54 AM