[TASK] Initial commit with basic product setup

This commit is contained in:
2019-08-18 13:50:14 +02:00
commit 01a66a8e1f
2548 changed files with 167528 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
namespace Mapbox.Examples
{
using KDTree;
using UnityEngine;
using Mapbox.Unity.MeshGeneration;
using Mapbox.Unity.MeshGeneration.Data;
public class HighlightBuildings : MonoBehaviour
{
public KdTreeCollection Collection;
public int MaxCount = 100;
public float Range = 10;
Ray ray;
Plane groundPlane = new Plane(Vector3.up, Vector3.zero);
Vector3 pos;
float rayDistance;
private NearestNeighbour<VectorEntity> pIter;
void Update()
{
if (Input.GetMouseButton(0))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (groundPlane.Raycast(ray, out rayDistance))
{
pos = ray.GetPoint(rayDistance);
pIter = Collection.NearestNeighbors(new double[] { pos.x, pos.z }, MaxCount, Range);
while (pIter.MoveNext())
{
pIter.Current.Transform.localScale = Vector3.zero;
}
}
}
}
}
}