document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. [System.Serializable]
  6. public class PlayerInfo  {
  7.  
  8.     public string playerName = "Default Name";
  9.     public int health = 100;
  10.     public List<InventoryItem> inventory = new List<InventoryItem>();
  11.  
  12.     public static PlayerInfo Load()
  13.     {
  14.         var playerInfo = Doofah.GenericSerialiser.LoadFromPlayerPrefs<PlayerInfo>("PlayerInfo");
  15.         return playerInfo != null ? playerInfo : new PlayerInfo();
  16.     }
  17.  
  18.     public void Save()
  19.     {
  20.         Doofah.GenericSerialiser.SaveToPlayerPrefs("PlayerInfo", this);
  21.     }
  22. }
');