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

public class BoostManager : MonoBehaviour {


	[SerializeField]List<Boost> boosts;

    int currentBoostSeleected;
	// Use this for initialization
	void Start () {
		foreach (Boost boosts in boosts) {
			boosts.Init ();

			boosts.boostManager = this;
		}
        currentBoostSeleected = Random.Range(0, boosts.Count);

        ChooseNextBoost ();
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public void ChooseNextBoost(){
        

		int nextBoost = Random.Range (0, boosts.Count);

        if(nextBoost == currentBoostSeleected)
        {
            nextBoost = (nextBoost + 1) % boosts.Count;
        }

		boosts [nextBoost].Activate ();

        currentBoostSeleected = nextBoost;

    }
}
