Created
May 20, 2018 20:10
-
-
Save ezdiy/37d5af82bf08531c7e12a36eb838f6da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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