• 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 /
  • Help Room /
avatar image
0
Question by Louis-LCM · Nov 22, 2015 at 04:03 PM · androidplayerprefssavingsave dataplayersettings

PlayerPrefs help !

Hi,

I tried in very much ways, but I really can't figure it out. This is a level lock/unlock system made by me. On my PC works perfectlly, but when I test it on my android smartphone nothing works. Why ? If I will use PlayerPrefs will work ? How I should use PlayerPrefs ? Because I tried in very much ways and no result.

Here is my script:

 using UnityEngine;
 using System.Collections;
 
 public class LevelLockSystem : MonoBehaviour {
 
     public GameObject unlockLevel2;
     public GameObject unlockLevel3;
     public GameObject unlockLevel4;
     public GameObject unlockLevel5;
     public GameObject unlockLevel6;
     public GameObject unlockLevel7;
     public GameObject unlockLevel8;
     public GameObject unlockLevel9;
     public GameObject unlockLevel10;
 
     public void Start()
     {
         
     }
 
     public void LockAllLevels()
     {
         unlockLevel2.SetActive(true);
         unlockLevel3.SetActive(true);
         unlockLevel4.SetActive(true);
         unlockLevel5.SetActive(true);
         unlockLevel6.SetActive(true);
         unlockLevel7.SetActive(true);
         unlockLevel8.SetActive(true);
         unlockLevel9.SetActive(true);
         unlockLevel10.SetActive(true);
     }
     public void UnlockLevel2()
     {
         unlockLevel2.SetActive(false);
     }
     public void UnlockLevel3()
     {
         unlockLevel3.SetActive(false);
     }
     public void UnlockLevel4()
     {
         unlockLevel4.SetActive(false);
     }
     public void UnlockLevel5()
     {
         unlockLevel5.SetActive(false);
     }
     public void UnlockLevel6()
     {
         unlockLevel6.SetActive(false);
     }
     public void UnlockLevel7()
     {
         unlockLevel7.SetActive(false);
     }
     public void UnlockLevel8()
     {
         unlockLevel8.SetActive(false);
     }
     public void UnlockLevel9()
     {
         unlockLevel9.SetActive(false);
     }
     public void UnlockLevel10()
     {
         unlockLevel10.SetActive(false);
     }
 
 }
Comment
Add comment · Show 1
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 fredz0004 · Nov 23, 2015 at 07:50 AM 0
Share

Hi Louis, Where exactly are you calling PlayerPref on this script? Is there another script?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Louis-LCM · Nov 23, 2015 at 11:03 AM

Problem Solved ! :D

Comment
Add comment · Show 1 · 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
avatar image fredz0004 · Nov 23, 2015 at 11:49 PM 0
Share

Care to share your answer for others to see.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

44 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 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

Saving In Between Scenes and Program Exit 0 Answers

Are playerprefs a safe way of saving data or not?? 2 Answers

How do I apply and save my game settings? 0 Answers

Problem saving with PlayerPrefs 0 Answers

PlayerPrefs Not Saving When I Click the Button. 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