2D Toolkit Forum

2D Toolkit => Support => Topic started by: fsadeq on June 19, 2012, 06:19:55 pm

Title: tk2DCameraAnchor question
Post by: fsadeq on June 19, 2012, 06:19:55 pm
Hello, I was wondering if there could be some alternate version of tk2CameraAnchor where an UpdateTransform isn't needed every frame. I don't have any elements in my GUI that require constant updating and this seems like a waste of calculations, especially when I have several anchors. Is this possible, short of just extending the main class?
Title: Re: tk2DCameraAnchor question
Post by: unikronsoftware on June 19, 2012, 11:39:59 pm
Extending it / commenting it out Update() might be the easiest thing to do - if you're concerned about those calculations you might as well not call update at all.
Title: Re: tk2DCameraAnchor question
Post by: coshea on January 30, 2014, 10:19:00 am
I was wondering about this too, a google search led me here.

Perhaps the tk2dCameraAnchor could have a tick box option of update at runtime that you can disable?

I only need to update my anchors once at the start based on the camera dimensions, not every frame.

Title: Re: tk2DCameraAnchor question
Post by: unikronsoftware on January 30, 2014, 10:39:02 am
I'm not sure that would be a good idea, it could end up causing a lot of confusion on why things stopped working. You could just attach a script that turns it off after a frame though? A coroutine start would do the job.

The computations in there are pretty trivial and shouldn't even be noticeable unless you have a huge number of them - how many anchors do you have?