rise-and-swine/Assets/Scripts/Assembly-CSharp/SecureJsonManager.cs
2023-02-25 23:04:03 -05:00

27 lines
658 B
C#

using System;
using System.Collections;
using UnityEngine;
public class SecureJsonManager
{
public SecureJsonManager(string newFileName)
{
this.fileName = newFileName;
}
public void Initialize(Action<string> onDataLoaded)
{
string rawAppConfig = Resources.Load<TextAsset>("rawAppConfig").text;
Hashtable hashtable = MiniJSON.jsonDecode(rawAppConfig) as Hashtable;
string key = this.fileName;
if (hashtable.ContainsKey(key))
{
if (onDataLoaded != null)
{
onDataLoaded(MiniJSON.jsonEncode(hashtable[key]));
}
}
}
protected string fileName;
}