using UnityEngine; public class EarthLayerProperties : MonoBehaviour { [Header("Layer Data")] public string layerName; // MIN_EARTH_RADIUS_M now pulled from the centralized constants file // No longer a private const here, as it's defined globally. [Tooltip("Outer radius of this layer from the Earth's center (in meters).")] public double outerRadius_m; [Range(0f, 1f)] // Changed to 0-1 for normalized percentage [Tooltip("Mass percentage of this layer relative to the total Earth mass (0-1).")] public float massPercentage; [Range(500f, 13000f)] // Adjusted range for average density [Tooltip("Average density of this layer (kg/m^3).")] public double averageDensity_kg_m3; [Range(0f, 400f)] // Adjusted range for average pressure [Tooltip("Average pressure at the base/center of this layer (GPa).")] public double averagePressure_GPa; [Range(-200f, 6000f)] // Adjusted range for average temperature [Tooltip("Average temperature range for this layer (°C).")] public double averageTemperature_C; [Range(0.01f, 1.0e25f)] // Adjusted range for viscosity to accommodate wide values [Tooltip("Viscosity of this layer (cP). Relevant for Outer Core, Mantle etc.")] public double viscosity_cP; // OnValidate is useful for editor-time checks private void OnValidate() { // Example validation: Outer radius should not be less than Inner Core radius if (outerRadius_m < EarthConstantsAndCalculations.INNER_CORE_OUTER_RADIUS_M && layerName != "Inner Core") { // Debug.LogWarning($"Layer '{layerName}' outer radius ({outerRadius_m}) is less than Inner Core radius. Check layer order or data."); } // More specific validation can be added here if needed, referencing other layer properties } } Planetary Instability Model PIM - Copyright (C) 2025 James Pacha