Exemplo n.º 1
0
 void DestroyHearts(int HeartsToDestroy)
 {
     for (int i = 1; i <= HeartsToDestroy; i++)
     {
         HealthHeart SelectetdHeart = HeartsList[AmountHearts - i];
         HeartsList.Remove(SelectetdHeart);
         Destroy(SelectetdHeart.gameObject);
     }
 }
Exemplo n.º 2
0
    void SpawnHeartOnStart()
    {
        for (int i = 0; i < AmountHearts; i++)
        {
            Vector3 HeartPosition = new Vector3((i - AmountHearts / 2) * 0.35f, -0.5f, 0f);

            HealthHeart freshHeart = Instantiate(heart, gameObject.transform.position + HeartPosition, Quaternion.identity);
            freshHeart.transform.SetParent(gameObject.transform);
            HeartsList.Add(freshHeart);
        }
    }