feat: load system
This commit is contained in:
parent
5d470a57af
commit
60d20bfe4e
20 changed files with 421 additions and 67 deletions
16
Assets/Scripts/Presenter/PlayerPrefsRepository.cs
Normal file
16
Assets/Scripts/Presenter/PlayerPrefsRepository.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using Domain;
|
||||
using Presenter.SaveSystem;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Presenter {
|
||||
public class PlayerPrefsRepository : IGameRepository {
|
||||
public void SaveScore(Score score) {
|
||||
PlayerPrefs.SetInt("Score", score.Value);
|
||||
}
|
||||
|
||||
public Score LoadScore() {
|
||||
int score = PlayerPrefs.GetInt("Score", 0);
|
||||
return new Score(score, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue