Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        Pingu pingu = other.GetComponent <Pingu>();

        if (pingu)
        {
            FoodManager.instance.Collected(this, pingu);
        }
    }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 public void Collected(Food food, Pingu pingu)
 {
     pingu.Feed(10);
     foodPool.Disable(food.gameObject);
 }