using UnityEngine;
using System.Collections;
using Holoville.HOTween;

public class Trail : MonoBehaviour {
	public float timeToLive;
	public Vector3 offset;

	// Use this for initialization
	void Start () {
		transform.position += offset;
		transform.Rotate(0,0,Random.Range(0,360));
		HOTween.To(transform, timeToLive, new TweenParms().Prop("localScale", Vector3.zero).Ease(EaseType.EaseOutQuad));
		HOTween.To(GetComponent<SpriteRenderer>(), timeToLive, new TweenParms().Prop("color", new Color(0,0,0,0.6f)).Ease(EaseType.EaseOutQuad));
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public IEnumerator timedDestroy() {
		yield return new WaitForSeconds(timeToLive);
		Network.Destroy(gameObject);
	}
}
