using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Echo : MonoBehaviour {
 
	public float lifetime = 3;	
	Transform myTransform;
	//public Vector3 dirSpeed = new Vector3(.01f,0,0);
	public float dirFloat = 1;

	void Awake()
	{
		myTransform = transform;
	}

	public void SetInitialDirection(Vector3 rot)
	{
		if(myTransform)
			myTransform.rotation = Quaternion.Euler(rot);
	}

	//Rigidbody2D r;
	void Start()
	{	
		
		//r =GetComponent<Rigidbody2D>();			
		Invoke("Cleanup",lifetime);
	}

	void Cleanup()
	{
		Destroy(gameObject);
	}

	void Update()
	{
	
		//myTransform.position +=  Vector3.right * dirFloat;//myTransform.rotation * ( dirSpeed * Time.deltaTime);
		myTransform.Translate(Vector3.right * Time.deltaTime * dirFloat);
	}
}
