static void ConvertVillagers(string inPath, string outPath) { if (!Directory.Exists(outPath)) { Directory.CreateDirectory(outPath); } DirectoryInfo di = new DirectoryInfo(inPath); FileInfo[] files = di.GetFiles(); foreach (var file in files) { if (file.Name.EndsWith("V.bytes")) { var villager = File.ReadAllBytes(file.FullName); Villager1 v1 = new Villager1(villager); Villager2 v2 = new Villager2(VillagerConverter.Convert12(villager)); File.WriteAllBytes(Path.Combine(outPath, file.Name), v2.Data); } } }
private void Start() { current = this; anim = gameObject.GetComponent <Animator>(); rig = gameObject.GetComponent <Rigidbody2D>(); }