import { Log } from "../log/Log" ; const PREFIX = "$unixie$" ; export class PlayerPrefs { static set ( key , value ? ) { if ( typeof key === "string" ) { localStorage . setItem ( `${ PREFIX }${ key }` , JSON . stringify ( value ) ) ; } else if ( typeof key === "object" && typeof value === "undefined" ) { for ( let k in key ) { this . set ( k , key [ k ] ) ; } } } static get ( key ) { let data = localStorage . getItem ( `${ PREFIX }${ key }` ) ; if ( ! data || data == "undefined" ) { return ; } return JSON . parse ( data ) ; } static remove ( key ) { localStorage . removeItem ( `${ PREFIX }${ key }` ) ; } static clear ( ) { localStorage . clear ( ) ; } }