Skip to content

Commit

Permalink
Add README file
Browse files Browse the repository at this point in the history
  • Loading branch information
murphyne committed Feb 23, 2023
1 parent 2b6f975 commit 2848a92
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PlayerPrefs Wrapper

This is a wrapper for the UnityEngine.PlayerPrefs API.


## Features

- Cleaner syntax for working with the PlayerPrefs API.
- Type safety for saving and retrieving data.
- Support for multiple data types, including int, float, string, bool.


## Installation

- Download the .tgz file from [Releases][Releases].
- Add the .tgz file to your Unity project [using the Package Manager][UPM-Tarball].

[Releases]:
https://github.com/murphyne/PlayerPrefsWrapper/releases

[UPM-Tarball]:
https://docs.unity3d.com/Manual/upm-ui-tarball.html


## Usage

```csharp
using PlayerPrefsWrapper;

public class Options
{
// Create an instance of wrapped PlayerPrefs value.
// Specify a key and an optional default value.
private readonly PlayerPrefBool _option1 = new PlayerPrefBool("Option1", true);

// Get value from PlayerPrefs.
public bool GetOption1() => _option1.Value;

// Set value to PlayerPrefs.
public void SetOption1(bool value) => _option1.Value = value;
}
```

0 comments on commit 2848a92

Please sign in to comment.