Skip to content

Instantly share code, notes, and snippets.

@ezdiy
Created May 20, 2018 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezdiy/37d5af82bf08531c7e12a36eb838f6da to your computer and use it in GitHub Desktop.
Save ezdiy/37d5af82bf08531c7e12a36eb838f6da to your computer and use it in GitHub Desktop.
using ADV;
using ParadoxNotion.Serialization.FullSerializer;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class AssPlug : MonoBehaviour
{
void Start()
{
var res = new Dictionary<string,ScenarioData>();
dump("adv/scenario/op", res);
for (int i = -10; i <= 0; i++)
dump($"adv/scenario/c{i}/00.unity3d", res);
for (int i = 0; i <= 30; i++)
dump($"adv/scenario/c{i:00}/00.unity3d", res);
fsData data = null;
Patchwork.Program.json.TrySerialize(res, out data).AssertSuccess();
File.WriteAllText("dump.json", fsJsonPrinter.PrettyJson(data));
}
void dump(string path, Dictionary<string,ScenarioData> res) {
int idx = 0;
while (true) {
var sidx = $"{idx++}";
var sd = CommonLib.LoadAsset<ScenarioData>(path, sidx);
if (sd == null) break;
res[path + "/" + sidx] = sd;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment