﻿using UnityEngine;

public static class VectorExtensions2
{
	public static Vector3 To3D(this Vector2 vec, float height)
	{
		return new Vector3(vec.x, height, vec.y);
	}
	
	public static Vector3 To3D(this Vector2 vec)
	{
		return vec.To3D(0);
	}
	
	public static Vector2 To2D(this Vector3 vec)
	{
		return new Vector2(vec.x, vec.z);
	}
	
	public static bool InRange(this Vector3 thisPosition, Vector3 otherPosition, float range)
	{
		return (thisPosition - otherPosition).magnitude <= range;
	}

}