Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }