using UnityEngine;
using System.Collections;

public class MeteorBehaviour : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	// Vector3.ClampMagnitude(v, maxLengtht)
	// Time.deltaTime
	// v.normalized

	void Update () {
		if (this.gameObject.name != "Meteor" && this.gameObject.name != "Spark") {
			this.transform.Translate (Vector3.down * 0.2f /* Referee.LevelSpeed*/);
		}
	}

	void OnCollisionEnter2D(Collision2D coll) {
//		animation.Play ("puppa");
		if (coll.gameObject.tag != "Enemy") {
			Debug.Log ("collisione");
			Destroy (this.gameObject);
		}
	}

	void OnCollisionStay2D(Collision2D coll) {
//		animation.Play ("puppa");
//		Debug.Log ("collisione");
//		Destroy (this.gameObject);	
		if (coll.gameObject.tag != "Enemy") {
			Debug.Log ("collisione");
			Destroy (this.gameObject);
		}

	}
}
