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

[ExecuteInEditMode]
public class BushBerries : MonoBehaviour
{
	private int range;
	public GameObject[] berries;
	[Range(0, 28)] public int berrieAmmount = 0;

	void Update()
	{
		berrieAmmount = Mathf.Clamp(berrieAmmount, 0, berries.Length);
		GatherBerries();
	}

	void GatherBerries()
	{
		for (int i = 0; i < berrieAmmount; i++)
		{
			berries[i].SetActive(true);
		}
		for (int i = berrieAmmount; i < berries.Length; i++)
		{
			berries[i].SetActive(false);
		}
	}
}
