Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        float  selected_latitude  = 40.71f;
        float  selected_longitude = -74f;
        Sprite selected_sprite    = Resources.Load <Sprite>("NewYork");

        WorldMapGlobe map = WorldMapGlobe.instance;

        map.calc.fromLatDec = selected_latitude;
        map.calc.fromLonDec = selected_longitude;
        map.calc.fromUnit   = UNIT_TYPE.DecimalDegrees;
        map.calc.Convert();
        Vector3 sphereLocation = map.calc.toSphereLocation;

        // Create sprite
        GameObject     destinationSprite = new GameObject();
        SpriteRenderer dest_sprite       = destinationSprite.AddComponent <SpriteRenderer>();

        dest_sprite.sprite = selected_sprite;

        // Add sprite billboard to the map with custom scale, billboard mode and little bit elevated from surface (to prevent clipping with city spots)
        map.AddMarker(destinationSprite, sphereLocation, 0.02f, true, 0.1f);

        // Locate it on the map
        map.FlyToLocation(sphereLocation);
        map.autoRotationSpeed = 0f;
    }
        void OnEnable()
        {
            Color backColor = EditorGUIUtility.isProSkin ? new Color(0.18f, 0.18f, 0.18f) : new Color(0.7f, 0.7f, 0.7f);

            _blackTexture           = MakeTex(4, 4, backColor);
            _blackTexture.hideFlags = HideFlags.DontSave;
            _map           = (WorldMapGlobe)target;
            _headerTexture = Resources.Load <Texture2D> ("EditorHeader");
            if (_map.countries == null)
            {
                _map.Init();
            }
            earthStyleOptions = new string[] {
                "Natural", "Solid Color"
            };
            earthStyleValues = new int[] {
                (int)EARTH_STYLE.Natural, (int)EARTH_STYLE.SolidColor
            };

            labelsQualityOptions = new string[] {
                "Low",
                "Medium",
                "High"
            };
            blackStyle = new GUIStyle();
            blackStyle.normal.background = _blackTexture;
        }
Beispiel #3
0
 private void CheckCloud()
 {
     if (worldMapGlobe == null)
     {
         worldMapGlobe = FindObjectOfType <WorldMapGlobe>();
     }
     if (!CanZoom)
     {
         worldMapGlobe.showCursor             = false;
         worldMapGlobe.enableCountryHighlight = false;
     }
 }
Beispiel #4
0
        void Awake()
        {
            Instance = this;
            // Get a reference to the World Map API:
            map = WorldMapGlobe.instance;

#if LIGHTSPEED
            Camera.main.fieldOfView = 180;
            animatingField          = true;
#endif
            map.earthInvertedMode     = false;
            map.mouseWheelSensitivity = 0.1f;
        }
Beispiel #5
0
        void OnEnable()
        {
            Color backColor = EditorGUIUtility.isProSkin ? new Color(0.18f, 0.18f, 0.18f) : new Color(0.7f, 0.7f, 0.7f);

            _blackTexture           = MakeTex(4, 4, backColor);
            _blackTexture.hideFlags = HideFlags.DontSave;
            _map           = (WorldMapGlobe)target;
            _headerTexture = Resources.Load <Texture2D> ("EditorHeader");
            if (_map != null && _map.countries == null)
            {
                _map.Init();
            }
            earthStyleOptions = new string[] {
                "Natural", "Natural (Scenic)", "Natural (8K)", "Natural (8K Scenic)", "Natural (8K Scenic Scatter)", "Alternate Style 1", "Alternate Style 2", "Alternate Style 3", "Solid Color", "Custom"
            };
            earthStyleValues = new int[] {
                (int)EARTH_STYLE.Natural, (int)EARTH_STYLE.Scenic, (int)EARTH_STYLE.NaturalHighRes, (int)EARTH_STYLE.NaturalHighResScenic, (int)EARTH_STYLE.NaturalHighResScenicScatter, (int)EARTH_STYLE.Alternate1, (int)EARTH_STYLE.Alternate2, (int)EARTH_STYLE.Alternate3, (int)EARTH_STYLE.SolidColor, (int)EARTH_STYLE.Custom
            };

            frontiersDetailOptions = new string[] {
                "Low",
                "High"
            };
            labelsQualityOptions = new string[] {
                "Low",
                "Medium",
                "High"
            };
            gridModeOptions = new string[] {
                "Overlay",
                "Masked"
            };
            gridModeValues = new int[] {
                (int)GRID_MODE.OVERLAY, (int)GRID_MODE.MASKED
            };

            navigationModeOptions = new string[] {
                "Earth Rotates",
                "Camera Rotates"
            };
            navigationModeValues = new int[] {
                (int)NAVIGATION_MODE.EARTH_ROTATES, (int)NAVIGATION_MODE.CAMERA_ROTATES
            };


            blackStyle = new GUIStyle();
            blackStyle.normal.background = _blackTexture;

            UpdateExtraComponentStatus();
        }
Beispiel #6
0
 // Use this for initialization
 void Awake()
 {
     map = WorldMapGlobe.instance;
 }