This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Assets/Scripts/Util/GeoDataContainer.cs

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;
}
}