Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        bool dirty = false;
        OnlineMapsControlBase control = target as OnlineMapsControlBase;

        OnlineMapsControlBaseEditor.CheckMultipleInstances(control, ref dirty);

        OnlineMaps api = OnlineMapsControlBaseEditor.GetOnlineMaps(control);

        OnlineMapsControlBaseEditor.CheckTarget(api, OnlineMapsTarget.texture, ref dirty);

#if !IGUI
        if (GUILayout.Button("Enable iGUI"))
        {
            OnlineMapsEditor.AddCompilerDirective("IGUI");
        }
#else
        base.OnInspectorGUI();
#endif

        if (dirty)
        {
            EditorUtility.SetDirty(api);
            Repaint();
        }
    }
Ejemplo n.º 2
0
 protected void DrawCurvedUIWarning()
 {
     EditorGUILayout.HelpBox("To make the map work properly with Curved UI, enable integration.", MessageType.Info);
     if (GUILayout.Button("Enable Curved UI"))
     {
         OnlineMapsEditor.AddCompilerDirective("CURVEDUI");
     }
 }
    public override void OnInspectorGUI()
    {
        bool dirty = false;

        OnlineMapsControlBase control = target as OnlineMapsControlBase;

        OnlineMapsControlBaseEditor.CheckMultipleInstances(control, ref dirty);

        OnlineMaps map = OnlineMapsControlBaseEditor.GetOnlineMaps(control);

        OnlineMapsControlBaseEditor.CheckTarget(map, OnlineMapsTarget.texture, ref dirty);

#if !NGUI
        if (GUILayout.Button("Enable NGUI"))
        {
            if (EditorUtility.DisplayDialog("Enable NGUI", "You have NGUI in your project?", "Yes, I have NGUI", "Cancel"))
            {
                OnlineMapsEditor.AddCompilerDirective("NGUI");
            }
        }
#else
        if (noColliderWarning)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUILayout.HelpBox("Potential problem detected:\nGameObject has no BoxCollider, so you can not control the map.", MessageType.Warning);
            if (GUILayout.Button("Add BoxCollider"))
            {
                BoxCollider bc        = map.gameObject.AddComponent <BoxCollider>();
                UITexture   uiTexture = map.GetComponent <UITexture>();
                if (uiTexture != null)
                {
                    bc.size = uiTexture.localSize;
                }
            }

            EditorGUILayout.EndVertical();
        }

        base.OnInspectorGUI();
#endif

        if (dirty)
        {
            EditorUtility.SetDirty(map);
            EditorUtility.SetDirty(control);
            if (!Application.isPlaying)
            {
#if UNITY_5_3P
                EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
#endif
            }
            else
            {
                map.Redraw();
            }
        }
    }
Ejemplo n.º 4
0
    public override void OnInspectorGUI()
    {
#if !NGUI
        if (GUILayout.Button("Enable NGUI"))
        {
            if (EditorUtility.DisplayDialog("Enable NGUI", "You have NGUI in your project?", "Yes, I have NGUI", "Cancel"))
            {
                OnlineMapsEditor.AddCompilerDirective("NGUI");
            }
        }
#else
        base.OnInspectorGUI();
#endif
    }
    public override void OnInspectorGUI()
    {
#if !RWT && !RWT3
        if (GUILayout.Button("Enable Real World Terrain"))
        {
            if (EditorUtility.DisplayDialog("Enable Real World Terrain", "You have Real World Terrain in your project?", "Yes, I have Real World Terrain", "Cancel"))
            {
                Assembly assembly = typeof(OnlineMapsRWTConnectorEditor).Assembly;
                if (assembly.GetType("InfinityCode.RealWorldTerrain.Windows.RealWorldTerrainWindow") != null)
                {
                    OnlineMapsEditor.AddCompilerDirective("RWT3");
                }
                else
                {
                    OnlineMapsEditor.AddCompilerDirective("RWT");
                }
            }
        }
#else
        OnlineMapsRWTConnector connector = (OnlineMapsRWTConnector)target;

        connector.mode = (OnlineMapsRWTConnectorMode)EditorGUILayout.EnumPopup("Mode: ", connector.mode);

        if (connector.mode == OnlineMapsRWTConnectorMode.markerOnPosition)
        {
            connector.markerTexture = (Texture2D)EditorGUILayout.ObjectField("Marker Texture", connector.markerTexture, typeof(Texture2D), false);
            connector.markerLabel   = EditorGUILayout.TextField("Marker Tooltip:", connector.markerLabel);
        }

        connector.positionMode = (OnlineMapsRWTConnectorPositionMode)EditorGUILayout.EnumPopup("Position mode: ", connector.positionMode);

        if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.transform)
        {
            connector.targetTransform = (Transform)EditorGUILayout.ObjectField("Target Transform", connector.targetTransform, typeof(Transform), true);
        }
        else if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.scenePosition)
        {
            connector.scenePosition = EditorGUILayout.Vector3Field("Position: ", connector.scenePosition);
        }
        else if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.coordinates)
        {
            connector.coordinates = EditorGUILayout.Vector2Field("Coordinates: ", connector.coordinates);
        }
#endif
    }
Ejemplo n.º 6
0
    public override void OnInspectorGUI()
    {
        bool dirty = false;

        OnlineMapsControlBase control = target as OnlineMapsControlBase;

        OnlineMapsControlBaseEditor.CheckMultipleInstances(control, ref dirty);

        OnlineMaps map = OnlineMapsControlBaseEditor.GetOnlineMaps(control);

        OnlineMapsControlBaseEditor.CheckTarget(map, OnlineMapsTarget.texture, ref dirty);

#if !DFGUI
        if (GUILayout.Button("Enable DFGUI"))
        {
            if (EditorUtility.DisplayDialog("Enable DFGUI", "You have DFGUI in your project?", "Yes, I have DFGUI", "Cancel"))
            {
                OnlineMapsEditor.AddCompilerDirective("DFGUI");
            }
        }
#else
        base.OnInspectorGUI();
#endif

        if (dirty)
        {
            EditorUtility.SetDirty(map);
            EditorUtility.SetDirty(control);
            if (!Application.isPlaying)
            {
#if UNITY_5_3P
                EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
#endif
            }
            else
            {
                map.Redraw();
            }
        }
    }
    public override void OnInspectorGUI()
    {
#if !TOUCHSCRIPT
        if (GUILayout.Button("Enable TouchScript"))
        {
            if (EditorUtility.DisplayDialog("Enable TouchScript", "You have TouchScript in your project?", "Yes, I have TouchScript", "Cancel"))
            {
                OnlineMapsEditor.AddCompilerDirective("TOUCHSCRIPT");
            }
        }
#else
        base.OnInspectorGUI();
        if (cameraOrbit == null)
        {
            EditorGUILayout.HelpBox("To use twist and tilt gestures, add Online Maps Camera Orbit component.", MessageType.Warning);
            if (GUILayout.Button("Add Camera Orbit"))
            {
                connector.gameObject.AddComponent <OnlineMapsCameraOrbit>();
            }
        }
#endif
    }
    public override void OnInspectorGUI()
    {
#if !EASYTOUCH
        if (GUILayout.Button("Enable EasyTouch"))
        {
            if (EditorUtility.DisplayDialog("Enable EasyTouch", "You have EasyTouch in your project?", "Yes, I have EasyTouch", "Cancel"))
            {
                OnlineMapsEditor.AddCompilerDirective("EASYTOUCH");
            }
        }
#else
        EditorGUILayout.HelpBox("This component does not require configuration.", MessageType.Info);
        if (cameraOrbit == null)
        {
            EditorGUILayout.HelpBox("To use twist and tilt gestures, add Online Maps Camera Orbit component.", MessageType.Warning);
            if (GUILayout.Button("Add Camera Orbit"))
            {
                connector.gameObject.AddComponent <OnlineMapsCameraOrbit>();
            }
        }
#endif
    }
Ejemplo n.º 9
0
    public override void OnInspectorGUI()
    {
#if !RWT
        if (GUILayout.Button("Enable Real World Terrain"))
        {
            OnlineMapsEditor.AddCompilerDirective("RWT");
        }
#else
        OnlineMapsRWTConnector connector = (OnlineMapsRWTConnector)target;

        connector.mode = (OnlineMapsRWTConnectorMode)EditorGUILayout.EnumPopup("Mode: ", connector.mode);

        if (connector.mode == OnlineMapsRWTConnectorMode.markerOnPosition)
        {
            connector.markerTexture = (Texture2D)EditorGUILayout.ObjectField("Marker Texture", connector.markerTexture,
                                                                             typeof(Texture2D), false);
            connector.markerLabel = EditorGUILayout.TextField("Marker Tooltip:", connector.markerLabel);
        }

        connector.positionMode = (OnlineMapsRWTConnectorPositionMode)EditorGUILayout.EnumPopup("Position mode: ", connector.positionMode);

        if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.transform)
        {
            connector.targetTransform =
                (Transform)
                EditorGUILayout.ObjectField("Target Transform", connector.targetTransform, typeof(Transform), true);
        }
        else if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.scenePosition)
        {
            connector.scenePosition = EditorGUILayout.Vector3Field("Position: ", connector.scenePosition);
        }
        else if (connector.positionMode == OnlineMapsRWTConnectorPositionMode.coordinates)
        {
            connector.coordinates = EditorGUILayout.Vector2Field("Coordinates: ", connector.coordinates);
        }
#endif
    }
    public override void OnInspectorGUI()
    {
#if !UNITY_2017_2_OR_NEWER || ONLINEMAPS_GUITEXTURE
        bool dirty = false;

        OnlineMapsControlBase control = target as OnlineMapsControlBase;
        OnlineMapsControlBaseEditor.CheckMultipleInstances(control, ref dirty);

        OnlineMaps map = OnlineMapsControlBaseEditor.GetOnlineMaps(control);
        OnlineMapsControlBaseEditor.CheckTarget(map, OnlineMapsTarget.texture, ref dirty);

        base.OnInspectorGUI();

        if (dirty)
        {
            EditorUtility.SetDirty(map);
            EditorUtility.SetDirty(control);
            if (!Application.isPlaying)
            {
#if UNITY_5_3P
                EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
#endif
            }
            else
            {
                map.Redraw();
            }
        }
#else
        EditorGUILayout.HelpBox("GUITexture is part of the legacy GUI, and will be removed in future versions of Unity Editor.", MessageType.Warning);
        if (GUILayout.Button("Enable GUITexture"))
        {
            OnlineMapsEditor.AddCompilerDirective("ONLINEMAPS_GUITEXTURE");
        }
#endif
    }