Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- [System.Serializable]
- public class PlayerInfo {
- public string playerName = "Default Name";
- public int health = 100;
- public List<InventoryItem> inventory = new List<InventoryItem>();
- public static PlayerInfo Load()
- {
- var playerInfo = Doofah.GenericSerialiser.LoadFromPlayerPrefs<PlayerInfo>("PlayerInfo");
- return playerInfo != null ? playerInfo : new PlayerInfo();
- }
- public void Save()
- {
- Doofah.GenericSerialiser.SaveToPlayerPrefs("PlayerInfo", this);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement