• 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 Kovenant · Apr 25, 2017 at 12:41 PM · c#playerprefsleaderboard

Local Leaderboard with unique names

I want to implement a leaderboard to a project I'm working on. Basically I doing a remake of Tanks! Tutorial..

I already implemented so that both players can enter a name before the game begins. Now I would like to add a Leaderboard to the game. At the end of each game (5 Rounds) I want to add the player's score to a leaderboard - if it's due to end up at the leaderboard ofc.

A simple leaderboard is, well, simple to create.. However, I would like a leaderboard that can detect if a player's name is already on the leaderboard and if it is.. Update the score of that entry, remove any duplicates and sort it..

This leaderboard doesn't need to be online, only stored locally; PlayerPrefs is what I guess is the easiest to use? Can anyone please help me?

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 saud_ahmed020 · Apr 25, 2017 at 12:54 PM 0
Share

@$$anonymous$$ovenant check this

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by GilbertoBitt · Apr 25, 2017 at 12:54 PM

Why don't make a "simple" leaderboard using Dictionary ? where the name is the key(string) and the int value is the score so when u want update u can simple verify if contains or simple add right away and if don't have the key now u add or if already had a key u simple did a update!

Here it's a link for a tutorial that can help!

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.

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

7 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

saving player prefs when app is closed 4 Answers

How Do You Have Multiple High Scores For 1 GameOverScene? 1 Answer

Car colour problem 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges