2023-08-22 04:15:05 +02:00
|
|
|
using Newtonsoft.Json;
|
2023-08-21 03:58:07 +02:00
|
|
|
using System;
|
2023-08-18 01:03:41 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2023-08-21 03:58:07 +02:00
|
|
|
using System.IO;
|
2023-08-18 01:03:41 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
2023-08-20 03:31:31 +02:00
|
|
|
public class JsonManager : MonoBehaviour
|
2023-08-18 01:03:41 +02:00
|
|
|
{
|
2023-08-21 03:58:07 +02:00
|
|
|
public static string JsonDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ZData", "SmallSchoolPlatformer");
|
2023-08-22 04:15:05 +02:00
|
|
|
public static int SelectedSave = 0;
|
2023-08-18 01:03:41 +02:00
|
|
|
|
2023-08-21 03:58:07 +02:00
|
|
|
public int Save { get; set; }
|
2023-08-22 04:15:05 +02:00
|
|
|
public static Charecter LoadChar()
|
2023-08-18 01:03:41 +02:00
|
|
|
{
|
2023-08-22 04:15:05 +02:00
|
|
|
string json = File.ReadAllText(Path.Combine(JsonDir, $"Save_{SelectedSave}.json"));
|
|
|
|
Charecter charecter = JsonConvert.DeserializeObject<Charecter>(json);
|
|
|
|
return charecter;
|
2023-08-18 01:03:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class Charecter
|
|
|
|
{
|
2023-08-22 04:15:05 +02:00
|
|
|
public int x, y, z;
|
2023-08-18 01:03:41 +02:00
|
|
|
}
|