x


How can I get the last frame before a new level was loaded ?

Hello ,

I need to detach some persitsant objects from my non-persitant MainCamera right before a new level was loaded.

OnLevelWasloaded is fired, as the name suggests, when the the new scene is loaded.

I am loading Asynchronous and I see no possibility to detach my objects just before my MainCam gets destryoed.

Async.isDone happens too late , and Async.progress always returns 0 until its done... which seems to be a bug according to other posts.

Is there any other way to make sure my objects are getting detached , right before the new scene starts ? (Something like : if (async.progress > 0.95f) Detach();

Thanks for any help,

oxl

more ▼

asked May 12 '10 at 09:45 AM

oxl gravatar image

oxl
225 4 3 13

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Perhaps you could do this from the camera's OnDisable event? I think this is called on objects when a new level causes them to be destroyed.

more ▼

answered May 12 '10 at 03:28 PM

duck gravatar image

duck ♦♦
40.9k 92 148 415

Thank you very much , that was indeed the solution for my problem , great !

Greets , oxl

May 13 '10 at 09:22 PM oxl
(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x715
x106
x42
x10

asked: May 12 '10 at 09:45 AM

Seen: 1193 times

Last Updated: May 12 '10 at 09:45 AM