Пример #1
0
        /// <summary>
        /// Gets the world map terrain from the scene
        /// </summary>
        /// <returns>The world map terrain</returns>
        public static Terrain GetWorldMapTerrain()
        {
            foreach (Terrain t in Terrain.activeTerrains)
            {
                if (TerrainHelper.IsWorldMapTerrain(t))
                {
                    return(t);
                }
            }

            //still no world map terrain? might be a deactivated GameObject, check those as well
            GameObject worldMapGO = GaiaUtils.FindObjectDeactivated(GaiaConstants.worldMapTerrainPrefix + "_", false);

            if (worldMapGO != null)
            {
                Terrain t = worldMapGO.GetComponent <Terrain>();
                if (t != null)
                {
                    return(t);
                }
            }
            return(null);
        }