public void SpawnBreeded(DNA mutatedDna, Pingu pingu, float energyForChild) { Pingu spawnedPingu = InstantSpawn(pingu.gameObject.transform.position).GetComponent <Pingu>(); spawnedPingu.Init(mutatedDna, GameManager.instance.GetRandomPointInScenario(minDistanceFromCenter), energyForChild); Debug.Log($"New Pingu spawned: {spawnedPingu.gameObject.name}", spawnedPingu.gameObject); }
private void Start() { for (int f = 0; f < initialPinguQtty; f++) { Pingu spawnedPingu = InstantSpawn().GetComponent <Pingu>(); DNA newDna = ScriptableObject.CreateInstance <DNA>(); newDna.SetValues(); spawnedPingu.Init(newDna, GameManager.instance.GetRandomPointInScenario(minDistanceFromCenter), startEnergy); } }