using UnityEngine;
using System.Collections;

public class BackgroundMaker : MonoBehaviour {

	public Transform[] prefabs;
	Transform curTransform;

	// Use this for initialization
	void Start () {
		
	}

	public void Unload() {
		if (curTransform != null) {
			GameObject.Destroy(curTransform.gameObject);
		}
	}

	public void Load(int index) {
		Unload();
		curTransform = (Transform)GameObject.Instantiate(prefabs[index]);
	}

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