Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This question was closed Jul 30, 2014 at 09:09 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
-1
Question by N00MKRAD · Jul 30, 2014 at 08:49 AM · androidplayerprefs

Android PlayerPrefs example? (I´m too stupid :c)

(Maybe my English isn´t perfect)

Hey, I want to use PlayerPrefs in my Android game, and I already read some stuff ´bout it, but I still don´t understand it.

Can someone give me a simple example how to do this in PlayerPrefs:

If the user starts the app, a "Welcome screen" will appear. But it would appear everytime the user loads the main menu scene.

  • If the user taps on "continue", it will save in the PlayerPrefs that the user saw the welcome screen.

  • If the user quits the game, it will delete the "welcome screen" stuff, so it will appear again if the user starts the app next time.

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 meat5000 ♦ · Jul 30, 2014 at 09:08 AM 0
Share

I'm sorry to be negative, but if you didn't understand what you read, why would you understand and example posted here?

You should attempt the script first, post your attempt and ask a question based on that.

UA doesn't take too kindly to "Write $$anonymous$$y Script".

https://www.google.co.uk/search?q=unity+playerprefs+examples&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb&gfe_rd=cr&ei=5LXYU4qk$$anonymous$$ITY8geJv4HwDQ

avatar image N00MKRAD · Jul 30, 2014 at 09:54 AM 0
Share

I cant give thumbs up anymore. Thanks for the downvote.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by siddharth3322 · Jul 30, 2014 at 08:58 AM

Here I provide example to you related to storing int value in player pref. You have to manage it something like bool for your need.

 public static void StoreDebutantPuzzleId(int puzzleId){
         PlayerPrefs.SetInt(Constants.PLAYERPREF_DEBUTANT_PUZZLEID,puzzleId);
        PlayerPrefs.Save();
     }
 
     public static int RetrieveDebutantPuzzleId(){
         return PlayerPrefs.GetInt(Constants.PLAYERPREF_DEBUTANT_PUZZLEID);
     }


Based on retrieve of this value you have to decide you have to show welcome screen or not. Pretty simple :)

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

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

PlayerPrefs in android 2 Answers

PlayerPrefs file wrong stored location 0 Answers

Double icon in Android app drawer 1 Answer

How to save a bool in playerprefs as false 1 Answer

GetInt can only be called from the main thread on Android 0 Answers


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