public void LoadDroidData(DroidData droidData) { spawnRate = droidData.SpawnRate; catchRate = droidData.CatchRate; attack = droidData.Attack; defense = droidData.Defense; hp = droidData.Hp; crySound = Resources.Load(droidData.CrySound) as AudioClip; }
public PlayerData(Player player) { xp = player.Xp; requiredXp = player.LevelBase; levelBase = player.LevelBase; lvl = player.Lvl; foreach (GameObject droidObject in player.Droids) { Droid droid = droidObject.GetComponent <Droid>(); if (droid != null) { DroidData data = new DroidData(droid); droids.Add(data); } } }