private BasicChar InstantiateVoreChar(VoreContainer container, VoreSave vs, BasicChar basicChar) { BasicChar loaded = Instantiate(basicChar, container.transform); loaded.name = vs.Name; JsonUtility.FromJsonOverwrite(vs.Prey, loaded); return(loaded); }
private void LoadPreys(VoreContainer container, List <VoreSave> saves, List <ThePrey> preys) { container.transform.KillChildren(); for (int i = 0; i < saves.Count && i < preys.Count; i++) { VoreSave vs = saves[i]; BasicChar loaded = preyPrefabs.Exists(n => n.name == vs.Name) ? InstantiateVoreChar(container, vs, preyPrefabs.Find(n => n.name == vs.Name)) : InstantiateVoreChar(container, vs, defaultPrefab); preys[i].SetPrey(loaded); } }