예제 #1
0
 public static void LoadOrInitializeInventory()
 {
     // Saving and loading.
     if (File.Exists(Path.Combine(Application.persistentDataPath, "inventory.json")))
     {
         Debug.Log("Found file inventory.json, loading inventory.");
         StoreInventory.LoadFromJSON(Path.Combine(
                                         Application.persistentDataPath, "inventory.json"));
     }
     else
     {
         Debug.Log("Couldn't find inventory.json, loading from template.");
         StoreInventory.InitializeFromDefault();
     }
 }
예제 #2
0
 // Load from the default, for situations where we just want to reset.
 public static void LoadFromTemplate()
 {
     StoreInventory.InitializeFromDefault();
 }