Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Jun 18, 2019 at 09:56 AM by staryzhelios for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by staryzhelios · Jun 18, 2019 at 09:36 AM · playerprefslevelcontrolresetleveling

HOW to PlayerPrefs.DeleteAll () in that only level ? HELP

Hello buddy, I made 3 levels and each level can reset minilevels in it.


level 1 = has 6 mini levels level 2 = has 3 mini levels level 3 = has 3 mini levels

but when i reset level 2 mini level, all level will reset even level 1, i just want level 2 to reset. something wrong with this code: PlayerPrefs.DeleteAll ();


HERE'S MY LEVEL 2, LEVEL CONTROL SCRIPT

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;

public class Lvl2Control : MonoBehaviour {

 public Button lv2x1, lv2x2, lv2x3;
 int levelPassed2;

 void Start () {
     levelPassed2 = PlayerPrefs.GetInt ("LevelPassed2");
     lv2x2.interactable = false;
     lv2x3.interactable = false;



     if (levelPassed2 == 19) {
         lv2x2.interactable = true;
         lv2x3.interactable = false;
     }

     if (levelPassed2 == 20) {
         lv2x2.interactable = true;
         lv2x3.interactable = true;
     }



 }

 public void levelToLoad (int level2)
 {
     UnityEngine.SceneManagement.SceneManager.LoadScene (level2);

 }

 public void resetPlayerPrefs2()
 {
               **//WHAT TO CODE HERE?? 
     //levelPassed2 = PlayerPrefs.DeleteAll ();**
 }

}

alt text

this is main level , level 1, 2 and 3

![alt text][2]

![alt text][2]

this is mini level in level 2

when I reset level 2, only level 2 minilevel 2.1 only can click, other 2.2, 2.3 ECT must be locked. HOW? And all minilevel in level 1 still unlocked and not locked. [2]: /storage/temp/140233-30.png

30.png (323.5 kB)
12.png (471.1 kB)
Comment
Add comment
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

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

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

How to make camera position relative to a specific target. 1 Answer

Why this middle code doesnt want to run, Playerpref problem 0 Answers

reset the level? 5 Answers

reset level on collision 3 Answers

Leveling UP/ Experience system using PlayerPrefs 2 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