Exemplo n.º 1
0
    private void DrawLabelsGUI()
    {
        if (mapType.isCustom)
        {
            return;
        }

        bool showLanguage;

        if (mapType.hasLabels)
        {
            OnlineMapsEditorUtils.PropertyField(pLabels, "Show labels?");
            showLanguage = pLabels.boolValue;
        }
        else
        {
            showLanguage = mapType.labelsEnabled;
            GUILayout.Label("Labels " + (showLanguage ? "enabled" : "disabled"));
        }
        if (showLanguage && mapType.hasLanguage)
        {
            EditorGUILayout.PropertyField(pLanguage);
            EditorGUILayout.HelpBox(mapType.provider.twoLetterLanguage ? "Use two-letter code such as: en": "Use three-letter code such as: eng", MessageType.Info);
        }
    }
Exemplo n.º 2
0
    private void DrawTroubleshootingGUI(ref bool dirty)
    {
        EditorGUILayout.BeginHorizontal(GUI.skin.box);
        float oldWidth = EditorGUIUtility.labelWidth;

        EditorGUIUtility.labelWidth = 220;
        GUILayout.Label("Use this props only if you have a problem!!!", warningStyle);
        EditorGUILayout.EndHorizontal();
        EditorGUI.BeginChangeCheck();

        OnlineMapsEditorUtils.PropertyField(pUseSoftwareJPEGDecoder, cUseSoftwareJPEGDecoder, "If you have problems decoding JPEG images, use software decoder.\nKeep in mind that this greatly affects performance.");

#if !UNITY_WEBGL
        if (control != null && control.resultIsTexture)
        {
            OnlineMapsEditorUtils.PropertyField(pRenderInThread, "If you have any problems with multithreading, disable this field.");
        }
#endif

        OnlineMapsEditorUtils.PropertyField(pNotInteractUnderGUI, "Should Online Maps ignore clicks if an IMGUI or uGUI element is under the cursor?");
        OnlineMapsEditorUtils.PropertyField(pStopPlayingWhenScriptsCompile, "Should Online Maps stop playing when recompiling scripts?");

        EditorGUIUtility.labelWidth = oldWidth;

        if (EditorGUI.EndChangeCheck())
        {
            dirty = true;
        }
    }
Exemplo n.º 3
0
    private void DrawSourceGUI(ref bool dirty)
    {
        EditorGUI.BeginDisabledGroup(OnlineMaps.isPlaying);

        OnlineMapsEditorUtils.PropertyField(pSource, "Source of tiles");

#if UNITY_WEBGL
        if (pSource.enumValueIndex != (int)OnlineMapsSource.Resources && pSource.enumValueIndex != (int)OnlineMapsSource.StreamingAssets)
        {
            EditorGUILayout.PropertyField(pUseProxy, new GUIContent("Use Proxy"));
            EditorGUI.BeginDisabledGroup(!pUseProxy.boolValue);

            EditorGUILayout.PropertyField(pProxyURL, new GUIContent("Proxy"));
            EditorGUI.EndDisabledGroup();
        }
#endif

        if (pSource.enumValueIndex != (int)OnlineMapsSource.Online)
        {
            if (GUILayout.Button("Fix Import Settings for Tiles"))
            {
                FixImportSettings();
            }
            if (GUILayout.Button("Import from GMapCatcher"))
            {
                ImportFromGMapCatcher();
            }

            if (pSource.enumValueIndex == (int)OnlineMapsSource.Resources || pSource.enumValueIndex == (int)OnlineMapsSource.ResourcesAndOnline)
            {
                OnlineMapsEditorUtils.PropertyField(pResourcesPath, "The path pattern inside Resources folder");
            }
            else
            {
                OnlineMapsEditorUtils.PropertyField(pStreamingAssetsPath, "The path pattern inside Streaming Assets folder");
#if UNITY_WEBGL
                EditorGUILayout.HelpBox("Streaming Assets folder is not available for WebGL!", MessageType.Warning);
#endif
            }

            EditorGUILayout.BeginVertical(GUI.skin.box);
            showResourcesTokens = Foldout(showResourcesTokens, "Available Tokens");
            if (showResourcesTokens)
            {
                GUILayout.Label("{zoom} - Tile zoom");
                GUILayout.Label("{x} - Tile x");
                GUILayout.Label("{y} - Tile y");
                GUILayout.Label("{quad} - Tile quad key");
                GUILayout.Space(10);
            }
            EditorGUILayout.EndVertical();
        }

        EditorGUI.EndDisabledGroup();

        DrawMapTypes(ref dirty);
    }
Exemplo n.º 4
0
    private void DrawAdvancedGUI()
    {
        float oldWidth = EditorGUIUtility.labelWidth;

        EditorGUIUtility.labelWidth = 160;

        if (control.resultIsTexture)
        {
            OnlineMapsEditorUtils.PropertyField(pRedrawOnPlay, "Redraw the map immediately after the start of the scene");
        }

        EditorGUI.BeginChangeCheck();
        OnlineMapsEditorUtils.PropertyField(pCountParentLevels, "Tiles for the specified number of parent levels will be loaded");
        if (EditorGUI.EndChangeCheck())
        {
            pCountParentLevels.intValue = Mathf.Clamp(pCountParentLevels.intValue, 0, 20);
        }

        OnlineMapsEditorUtils.PropertyField(pTraffic, "Display traffic jams");
        if (pTraffic.boolValue)
        {
            EditorGUI.BeginChangeCheck();
            trafficProviderIndex = EditorGUILayout.Popup(new GUIContent("Traffic Provider"), trafficProviderIndex, cTrafficProviders);
            if (EditorGUI.EndChangeCheck())
            {
                pTrafficProviderID.stringValue = trafficProviders[trafficProviderIndex].id;
            }
            if (trafficProviders[trafficProviderIndex].isCustom)
            {
                EditorGUILayout.PropertyField(pCustomTrafficProviderURL, new GUIContent("URL"));
            }
        }

        OnlineMapsEditorUtils.PropertyField(pEmptyColor, "The color that will be displayed until the tile is loaded.\nImportant: if Default Tile Texture is specified, this value will be ignored.");

        EditorGUI.BeginChangeCheck();
        OnlineMapsEditorUtils.PropertyField(pDefaultTileTexture, "The texture that will be displayed until the tile is loaded");
        if (EditorGUI.EndChangeCheck())
        {
            CheckAPITextureImporter(pDefaultTileTexture);
        }

        OnlineMapsEditorUtils.PropertyField(pTooltipTexture, cTooltipTexture, "Tooltip background texture");
        OnlineMapsEditorUtils.PropertyField(pShowMarkerTooltip, "Tooltip display rule");

        EditorGUIUtility.labelWidth = oldWidth;
    }