using UnityEngine;
using System.Collections;

public class Gas : MonoBehaviour {

	private Transform target;

	private float moveSpeed = 500.0f;

	public void init(Transform target, Color color) {
		this.target = target;
		renderer.material.color = color;
	}

	public void Update() {
		float dt = Time.deltaTime;
		Vector3 dir = (target.position - transform.position).normalized;
		Debug.Log ("Move to " + dir.ToString ("F4"));
		transform.position = transform.position + dir * moveSpeed * dt;
	}
}
