34 lines
829 B
C#
34 lines
829 B
C#
using System;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using ARLocation;
|
|
using UnityEngine.Serialization;
|
|
|
|
|
|
[Serializable]
|
|
public struct Coords
|
|
{
|
|
public List<DVector3> coords;
|
|
}
|
|
[Serializable]
|
|
public class GeoData
|
|
{
|
|
public string key;
|
|
public List<Coords> values; // ÓÃ Vector3 Ìæ´ú double[3]
|
|
}
|
|
|
|
[CreateAssetMenu(fileName = "NewDataAsset", menuName = "ScriptableObjects/GeoDataAsset", order = 1)]
|
|
public class GeoDataContainer : ScriptableObject
|
|
{
|
|
public List<GeoData> geoDatas;
|
|
public Dictionary<string, IReadOnlyList<Coords>> ToDictionary()
|
|
{
|
|
Dictionary<string, IReadOnlyList<Coords>> dict = new Dictionary<string, IReadOnlyList<Coords>>();
|
|
foreach (var geoData in geoDatas)
|
|
{
|
|
dict[geoData.key] = geoData.values;
|
|
}
|
|
return dict;
|
|
}
|
|
|
|
} |