Files
DTrierFlood_Linux/Assets/Scripts/GeoDataUtils/GeoTileMetadata.cs
s0wlz (Matthias Puchstein) da213b4475 updated the build pipeline
2026-01-14 21:17:51 +01:00

27 lines
724 B
C#

using UnityEngine;
/// <summary>
/// Component attached to tile prefab roots to store geo metadata.
/// Useful for positioning prefabs in scene or querying tile info at runtime.
/// </summary>
public class GeoTileMetadata : MonoBehaviour
{
public string tileId;
public double xmin;
public double ymin;
public double globalMin;
public double globalMax;
/// <summary>
/// Returns the world position this tile should be placed at, given a global origin.
/// </summary>
public Vector3 GetWorldPosition(double originX, double originY)
{
return new Vector3(
(float)(xmin - originX),
(float)globalMin,
(float)(ymin - originY)
);
}
}