using UnityEngine;
using System.Collections;

public class FXDemonSpawn : MonoBehaviour {

	public GameObject fxPrefab;
	public float radius = 1f;
	public int numParticles = 10;
	public bool inwards = true;

	// Use this for initialization
	void Start () {

		for(int i=0; i < numParticles; i++) {
			Quaternion rot = Quaternion.Euler(0, 0, 360f / numParticles * i) * transform.rotation;
			Vector3 offset = rot * new Vector3(radius, 0, 0);
			((GameObject)Instantiate(fxPrefab, transform.position + (offset), rot)).GetComponent<FXParticle>().speed *= inwards ? -1f : 1f;
		}

		Destroy(gameObject);

	}
	
}
