using UnityEngine;
using System.Collections;

public class CreateLava : MonoBehaviour {
	public Transform lava, smoke;
	
	public Transform baseLava;
	// Use this for initialization
	void Start () {
		InvokeRepeating("CreateLavaItem",0.3f, 0.9f);
		InvokeRepeating("CreateSmokeItem",0.6f, 1.2f);
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void CreateLavaItem()
	{
		Instantiate(lava, baseLava.position,baseLava.rotation);
	}
	
	void CreateSmokeItem()
	{
		
		
		Transform t = Instantiate(smoke, baseLava.position,baseLava.rotation) as Transform;
		Vector3 p = t.localEulerAngles;
		p.y = Random.Range(-20,20);
		p.z = Random.Range (0,20);
		t.localEulerAngles = p;
		
	}
}
