public static void AddGoalPoint(float3 goalPoint) { if (goalPoints.Length > 0) { var min = ClosestGoalPoint(goalPoint); if (math.length(goalPoints[min] - goalPoint) < minDistance) { return; } } goalPoints.Add(goalPoint); var layer = new NativeArray <float>(Map.OneLayer, Allocator.TempJob); densityMatrix.AddRange(layer); tempMatrix.AddRange(layer); layer.Dispose(); DebugProxy.Log(goalPoint + " / " + goalPoints.Length); }
private void Debug(MapValues values, int groupId, Color color) { DebugProxy.Log("Debug Draw Before"); if (goalPoints.Length == 0 || groupId < 0) { return; } DebugProxy.Log("Debug Draw"); for (int index = values.LayerSize * groupId; index < values.LayerSize * (groupId + 1); index += 7) { var small = index % values.LayerSize; var height = small / values.heightPoints; var width = small % values.heightPoints; var point = QuadrantVariables.ConvertToWorld(new float3(height, 0, width), values); if (densityMatrix[index] > 0f) { var minValue = GetMinValue(index, Map.Values, groupId, ShortestPathSystem.densityMatrix); DebugProxy.DrawLine(point, point + minValue.offsetVector, color); } } }