Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ronronmx · Sep 03, 2011 at 04:23 AM · playerprefssaving

Can I transfer the PlayerPrefs.plist file to the iPhone?

I'm not sure if this is possible or not, and maybe there's another way to do this...

I'm saving a bunch of settings to a PlayerPrefs file which I then read on game launch to load default values for different classes.

The problem is that the saved PlayerPrefs file doesn't exist on the iPhone when the game is launched for the first time, so since it can't find those saved values, it uses whatever default values are assigned in the "PlayerPrefs.GetFloat("MyValue", defaultValue)" call.

Is there any way to "transfer" the PlayerPrefs file from the computer to the iPhone when making builds? Am i gonna have to write those values to a text file which I would then access when the game runs?

Thanks for your time! Stephane

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mohanrao164 · Sep 03, 2011 at 05:20 AM 0
Share

why do u want to transfer the plist file.what are default values u are setting set them in the "awake" or the "start" function. so when u load game they will assigs the values.

avatar image ronronmx · Sep 03, 2011 at 05:34 AM 0
Share

The reason is I created a EditorGUI tool which lets me change all the default values for my upgrade system, and saves them as the starting values for the class. I wanted to use a GUITool so that I wouldn't have to go inside the class to change them or have the class attached to a GameObject to change them in the editor.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Graham-Dunnett · May 15, 2013 at 10:35 AM

I don't think that there is a way to do this with player prefs. I think the solution that I'd look into (if faced with the same problem) is to transfer to the phone a text file or xml document with the initial values in. Note that your can mark your application as sharing files with iTunes, so you can copy files to/from the app. Look up UIFileSharingEnabled to see how to make this change. Then you can drag and drop your text file to the device. Alternatively I think there is something like StreamingAssets folder, which gets copied to the device when you do a build and run. Anyway, once that text document is on the device you can read it and create the player prefs.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

how to save a load a game? 1 Answer

Whats the best way to save an enum state from scene to scene??? 1 Answer

Saving screenshot to iPhone Camera Roll 3 Answers

Using playerprefs to remember a level completion 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges