Fix loading
This commit is contained in:
@@ -30,24 +30,23 @@ public class BazookaManager : MonoBehaviour
|
||||
var cache = LoadArray("cache");
|
||||
if (save != null)
|
||||
{
|
||||
saveFile = save;
|
||||
if (saveFile["version"] == null)
|
||||
if (save["version"] != null && (save["version"].ToString() == "0" || save["version"].ToString() == "1"))
|
||||
{
|
||||
saveFile["version"] = "0";
|
||||
}
|
||||
if (saveFile["version"].ToString() == "0")
|
||||
{
|
||||
if (saveFile["bird"]["customIcon"]["data"] != null)
|
||||
saveFile = save;
|
||||
if (saveFile["version"].ToString() == "0")
|
||||
{
|
||||
var data = saveFile["bird"]["customIcon"]["data"];
|
||||
var customData = GetCustomBirdIconData();
|
||||
saveFile["bird"]["customIcon"]["data"].Parent.Remove();
|
||||
foreach (var icon in data)
|
||||
if (icon["uuid"].ToString() != null) customData.Purchased.Add(icon["uuid"].ToString());
|
||||
SetCustomBirdIconData(customData);
|
||||
if (saveFile["bird"]["customIcon"]["data"] != null)
|
||||
{
|
||||
var data = saveFile["bird"]["customIcon"]["data"];
|
||||
var customData = GetCustomBirdIconData();
|
||||
saveFile["bird"]["customIcon"]["data"].Parent.Remove();
|
||||
foreach (var icon in data)
|
||||
if (icon["uuid"].ToString() != null) customData.Purchased.Add(icon["uuid"].ToString());
|
||||
SetCustomBirdIconData(customData);
|
||||
}
|
||||
saveFile["version"] = "1";
|
||||
Save("savefile", saveFile);
|
||||
}
|
||||
saveFile["version"] = "1";
|
||||
Save("savefile", saveFile);
|
||||
}
|
||||
}
|
||||
if (cache != null)
|
||||
|
||||
Reference in New Issue
Block a user