x


Way to check if PlayerPrefs.Save() has completed?

In the script reference for this function call it states that it could cause a hiccup while data is being written to the disk. So obviously it would be best to call it within some sort of menu. What I would like to know is whether there is a way to tell when the function has been completed so that the player cannot leave the menu until the function has been performed. Or does the function completes quickly enough to where I could simply put a timer of a few seconds or so?

Thanks in advance -Apples

more ▼

asked Jul 29 '12 at 10:48 PM

Apples_mmmmmmmm gravatar image

Apples_mmmmmmmm
188 5 9 17

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

1 answer: sort voted first

All functions are atomic (well, almost all--there are a few exceptions like LoadLevelAsync). You don't use timers or anything, because the code can't do anything else until the function is done anyway. Otherwise there wouldn't be a hiccup.

more ▼

answered Jul 30 '12 at 12:56 AM

Eric5h5 gravatar image

Eric5h5
80.2k 41 132 519

Thanks for clarification.

Jul 30 '12 at 03:52 AM Apples_mmmmmmmm
(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:

x4146
x347
x1

asked: Jul 29 '12 at 10:48 PM

Seen: 334 times

Last Updated: Jul 30 '12 at 03:52 AM