using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Tree : Layers{
    float plant0, plant1, plant2, plant3, plant4;
    public GameObject[] plants;
    void Start(){
        plant0 = 0.1f;
        plant1 = plant0;
        plant2 = plant0;
        plant3 = plant0;
        plant4 = plant0;
    }
    void Update(){
        Layer();
        if(plants[0].transform.localScale.y < 1f){
            plant0 += 0.9f * Time.deltaTime;
            plants[0].transform.localScale = new Vector2(plants[0].transform.localScale.x, plant0);
        }
        if(plants[1].transform.localScale.y < 1f){
            plant1 += 0.5f * Time.deltaTime;
            plants[1].transform.localScale = new Vector2(plants[1].transform.localScale.x, plant1);
        }
        if(plants[2].transform.localScale.y < 1f){
            plant2 += 0.4f * Time.deltaTime;
            plants[2].transform.localScale = new Vector2(plants[2].transform.localScale.x, plant2);
        }
        if(plants[3].transform.localScale.y < 1f){
            plant3 += 0.3f * Time.deltaTime;
            plants[3].transform.localScale = new Vector2(plants[3].transform.localScale.x, plant3);
        }
        if(plants[4].transform.localScale.y < 0.25f){
            plant4 += 0.2f * Time.deltaTime;
            plants[4].transform.localScale = new Vector2(plants[4].transform.localScale.x, plant4);
        }
    }
}
