using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class SpawnRockIndex : MonoBehaviour {

	public RockSpawner rockSpawner;
	public Text indexText;

	int index = 0;

	public void ChangeIndex(int direction)
	{
		index += direction;
		index = Mathf.Clamp(index, 0, rockSpawner.rockPrefabs.Count);
		indexText.text = index.ToString();
	}

	public void Spawn()
	{
		rockSpawner.SpawnRock(index);
	}
}
