using System;
using UnityEngine;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;


public static class Havva
{

    static Havva()
    {
        JsonConvert.DefaultSettings = () => { return DefaultUseJsonSettings; };
    }

    private static JsonSerializerSettings DefaultUseJsonSettings = new JsonSerializerSettings
    {
        Formatting = Formatting.None,


        DateFormatHandling = DateFormatHandling.MicrosoftDateFormat,

        DateFormatString = "yyyy/MM/dd hh:mm:ss",
    };

    public static string ToJson(object obj)
    {
        return JsonConvert.SerializeObject(obj, DefaultUseJsonSettings);
    }

    public static T ToObject<T>(string json)
    {
        return JsonConvert.DeserializeObject<T>(json);
    }

}