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


public class RandowTree : MonoBehaviour 
{

	public GameObject wood;
	public GameObject top;

	public Sprite wood1;
	public Sprite wood2;
	public Sprite wood3;
	public Sprite wood4;
	public Sprite wood5;
	public Sprite wood6;
	public Sprite wood7;
	public Sprite wood8;

	public Sprite top1;
	public Sprite top2;
	public Sprite top3;
	public Sprite top4;
	public Sprite top5;
	public Sprite top6;
	public Sprite top7;
	public Sprite top8;

	
	public int numListWood;
	public int numListTop;
	
	private List<Sprite> Woods;
	private List<Sprite> Tops;
	// Use this for initialization
	void Start ()
	{
		Tops = new List<Sprite>();
		Woods = new List<Sprite>();

		Tops.Add(top1);
		Tops.Add(top2);
		Tops.Add(top3);
		Tops.Add(top4);
		Tops.Add(top5);
		Tops.Add(top6);
		Tops.Add(top7);
		Tops.Add(top8);

		Woods.Add(wood1);
		Woods.Add(wood2);
		Woods.Add(wood3);
		Woods.Add(wood4);
		Woods.Add(wood5);
		Woods.Add(wood6);
		Woods.Add(wood7);
		Woods.Add(wood8);

		numListWood = Random.Range(0, 7);
		numListTop = Random.Range(0, 7);

		for (int i = 0; i < Woods.Count; i++)
		{
			wood.GetComponent<SpriteRenderer>().sprite = Woods[numListWood];
		}
		for (int i = 0; i < Tops.Count; i++)
		{
			top.GetComponent<SpriteRenderer>().sprite = Tops[numListTop];
		}

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