Skip to content

Provides a handful of useful additional PlayerPref Get and Set methods

Notifications You must be signed in to change notification settings

Comp3interactive/PlayerPrefExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

PlayerPrefs Extensions

Simply put this script anywhere inside your project's asset folder and call the static methods from wherever you require.

You'll now be able to Get and Set bools, Vector2s, Vector3s and Quaternions!

These methods can be used in exactly the same way as the standard Unity PlayerPrefs system. Simply call Comp3PlayerPrefs.SetBool("MyBool", true); for example and then to retrieve call Comp3PlayerPrefs.GetBool("MyBool");. Also, the standard PlayerPrefs.HasKey(string key); and PlayerPrefs.DeleteAll(); methods will include these new PlayerPrefs too!

New Methods:

SetBool(string key, bool val)
GetBool(string key)
SetVector3(string key, Vector3 v3)
GetVector3(string key)
SetVector2(string key, Vector2 v2)
GetVector2(string key)
SetQuaternion(string key, Quaternion q)
GetQuaternion(string key)

About

Provides a handful of useful additional PlayerPref Get and Set methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages