Esempio n. 1
0
    protected override void InnerCopyTo(OnlineTexture copy)
    {
        GoogleMapsTexture target = (GoogleMapsTexture)copy;

        target.serverUrl     = serverUrl;
        target.initialSector = initialSector;
        target.latitude      = latitude;
        target.longitude     = longitude;
        target.initialZoom   = initialZoom;
    }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (Application.isPlaying)
        {
            EditorGUILayout.LabelField("Currently play mode editting is not allowed");
            return;
        }

        GoogleMapsTexture mapsTexture = (GoogleMapsTexture)target;

        EditorGUILayout.HelpBox("HCH: The Tile Image URL I'm using for our 3d demo purposes is not a proper Bing authorized URL, as we have not procured a proper API key", MessageType.Warning);

        string errorMessage = "";

        if (GoogleMapsTexture.ValidateServerURL(mapsTexture.CurrentFixedUrl(), out errorMessage) == false)
        {
            EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
        }

        mapsTexture.latitude  = EditorGUILayout.FloatField(lattitudeLabel, mapsTexture.latitude);
        mapsTexture.longitude = EditorGUILayout.FloatField(longitudeLabel, mapsTexture.longitude);
        int zoom = EditorGUILayout.IntSlider(zoomLabel, mapsTexture.initialZoom, MIN_ZOOM, MAX_ZOOM);

        foreach (GoogleMapsTexture t in targets)
        {
            t.initialZoom = zoom;
            t.ComputeInitialSector();
        }

        if (GUILayout.Button("Update preview (may take a while)"))
        {
            foreach (GoogleMapsTexture t in targets)
            {
                t.RequestTexturePreview();
            }
        }

        if (mapsTexture.IsDownloading())
        {
            EditorGUILayout.HelpBox("Downloading texture from server...", MessageType.Info);
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(mapsTexture);
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
        }
    }