コード例 #1
0
        public string GetBiomeString()
        {
            string biome_desc = "";

            CBAttributeMap.MapAttribute mapAttribute;

            try
            {
                CBAttributeMap BiomeMap = ActiveVessel.mainBody.BiomeMap;

                double lat = ActiveVessel.latitude * Math.PI / 180d;
                double lon = ActiveVessel.longitude * Math.PI / 180d;

                mapAttribute = BiomeMap.GetAtt(lat, lon);

                biome_desc = mapAttribute.name;
            }
            catch (NullReferenceException)
            {
                mapAttribute      = new CBAttributeMap.MapAttribute();
                mapAttribute.name = "N/A";
            }

            return(biome_desc);
        }
コード例 #2
0
        public CBAttributeMap.MapAttribute GetBiome()
        {
            CBAttributeMap.MapAttribute mapAttribute;

            try
            {
                CBAttributeMap BiomeMap = ActiveVessel.mainBody.BiomeMap;

                double lat = ActiveVessel.latitude * Math.PI / 180d;
                double lon = ActiveVessel.longitude * Math.PI / 180d;

                mapAttribute = BiomeMap.GetAtt(lat, lon);
            }
            catch (NullReferenceException)
            {
                mapAttribute      = new CBAttributeMap.MapAttribute();
                mapAttribute.name = "N/A";
            }

            return(mapAttribute);
        }