using UnityEngine;
using System.Collections;

public class ParticleBehavior : MonoBehaviour 
{
	private ParticleSystem _particleComponent;
	private GazeAwareComponent _gazeAwareComponent;

	// Use this for initialization
	void Start () 
	{
		_particleComponent = GetComponent<ParticleSystem>();
		_gazeAwareComponent = GetComponent<GazeAwareComponent>();
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (_gazeAwareComponent.HasGaze) 
		{
			_particleComponent.enableEmission = true;
		}
		else
		{
			_particleComponent.enableEmission = false;
		}
	}
}