骑行计算逻辑调整
This commit is contained in:
1 parent
971a6f7e0e
commit
0ab0e99597
15 files changed
+309
-393
No files matched your search
@@ -1,20 +1,15 @@
|
||||
namespace Mapbox.Unity.MeshGeneration.Factories
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Mapbox.Unity.Map;
|
||||
using Data;
|
||||
using Modifiers;
|
||||
using Mapbox.Utils;
|
||||
using Mapbox.Unity.Utilities;
|
||||
using System.Collections;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Mapbox.Unity.Map;
|
||||
using Mapbox.Utils;
|
||||
using System.Collections;
|
||||
using Mapbox.Unity.MeshGeneration.Modifiers;
|
||||
using Mapbox.Unity.MeshGeneration.Data;
|
||||
|
||||
public class RouteController : MonoBehaviour
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class RouteController : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
AbstractMap _map;
|
||||
@@ -48,7 +43,7 @@
|
||||
{
|
||||
modifier.Initialize();
|
||||
}
|
||||
|
||||
|
||||
StartCoroutine(QueryTimer());
|
||||
}
|
||||
|
||||
@@ -71,22 +66,18 @@
|
||||
var meshData = new MeshData();
|
||||
var dat = new List<Vector3>();
|
||||
|
||||
List<Vector2d> points = MockData.vl;
|
||||
if (points == null)
|
||||
var mapData = GameManger.MapData;
|
||||
if (mapData != null)
|
||||
{
|
||||
points = MockData.GetRideList();
|
||||
}
|
||||
{
|
||||
foreach (var point in points)
|
||||
foreach (var mapDataItem in mapData.List)
|
||||
{
|
||||
Vector3 item = _map.GeoToWorldPosition(point);//point.x, point.y, _map.CenterMercator, _map.WorldRelativeScale);
|
||||
//item.y = (float)(_map.QueryElevationInUnityUnitsAt(point))+0.3f;
|
||||
item.y += 0.5f;
|
||||
var point = mapDataItem.Point;
|
||||
Vector3 item = _map.GeoToWorldPosition(new Vector2d(point[0], point[1]));
|
||||
item.y += 0.4f;
|
||||
dat.Add(item);
|
||||
}
|
||||
var feat = new VectorFeatureUnity();
|
||||
feat.Points.Add(dat);
|
||||
|
||||
foreach (MeshModifier mod in MeshModifiers.Where(x => x.Active))
|
||||
{
|
||||
mod.Run(feat, meshData, _map.WorldRelativeScale * 8);
|
||||
@@ -102,7 +93,7 @@
|
||||
{
|
||||
_directionsGO.Destroy();
|
||||
}
|
||||
_directionsGO = new GameObject("direction waypoint " + " entity");
|
||||
_directionsGO = new GameObject("MapRoute");
|
||||
var mesh = _directionsGO.AddComponent<MeshFilter>().mesh;
|
||||
mesh.subMeshCount = data.Triangles.Count;
|
||||
|
||||
|
||||
Reference in new issue
Block a user