using UnityEngine;
using System.Collections;

public class MovingPlatform : MonoBehaviour {

	[SerializeField] private Vector2 initialVelocity;
	
	private void Awake() {
		if (rigidbody != null) rigidbody.velocity = new Vector3(initialVelocity.x, 0, initialVelocity.y);
	}
	
	#if UNITY_EDITOR
	private Vector3 velocityVector = new Vector3(-1, -1, -1);
	
	private void OnDrawGizmos() {
		Gizmos.color = Color.blue;
		if (velocityVector.x != initialVelocity.x || velocityVector.z != initialVelocity.y) {
			velocityVector = new Vector3(initialVelocity.x, 0, initialVelocity.y);
		}
		Gizmos.DrawLine(transform.position, transform.position + velocityVector);
	}
	#endif
}
