using UnityEngine;
using System.Collections;

public class ExplosionInstantiatorScript : MonoBehaviour {

	public GameObject smallExplosion;
	public GameObject bigExplosion;

	public static ExplosionInstantiatorScript instance;

	// Use this for initialization
	void Start () {
		instance = this;
	}
	
	public GameObject InstantiateExplosion(int codExplosion, Vector3 initialPosition, float radius, int numExplosions){
		GameObject newExplosion;
		if (codExplosion == 0) {
			newExplosion = Instantiate (smallExplosion, initialPosition, Quaternion.identity) as GameObject;
		} else {
			newExplosion = Instantiate (bigExplosion, initialPosition, Quaternion.identity) as GameObject;
		}
		BigExplosionScript explosion = newExplosion.GetComponent<BigExplosionScript> ();
		explosion.initialPosition = initialPosition;
		explosion.radius = radius;
		explosion.numExplosions = numExplosions;
		return newExplosion;
	}
}
