Ejemplo n.º 1
0
    private static bool Init()
    {
        try
        {
            headerStyle = new GUIStyle();
            headerStyle.normal.background = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Logo.png", true);
            headerStyle.normal.textColor  = Color.white;
            headerStyle.padding           = new RectOffset(330, 0, 30, 0);
            headerStyle.margin            = new RectOffset(0, 0, 0, 0);

            copyrightStyle           = new GUIStyle();
            copyrightStyle.alignment = TextAnchor.MiddleRight;

            wizardTexture    = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Wizard.png", true);
            playmakerTexture = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Playmaker.png", true);
            docTexture       = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Docs.png", true);
            forumTexture     = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Forum.png", true);
            apiTexture       = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\API.png", true);
            examplesTexture  = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Examples.png", true);
            updateTexture    = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Update.png", true);
            supportTexture   = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\Editor\\Welcome\\Support.png", true);

            inited = true;
        }
        catch
        {
            return(false);
        }
        return(true);
    }
    protected override void OnEnableLate()
    {
        base.OnEnableLate();

        defaultTexture    = serializedObject.FindProperty("defaultTexture");
        defaultAlign      = serializedObject.FindProperty("defaultAlign");
        allowAddMarkerByM = serializedObject.FindProperty("allowAddMarkerByM");

        if (defaultTexture.objectReferenceValue == null)
        {
            defaultTexture.objectReferenceValue = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Textures\\Markers\\DefaultMarker.png");
        }
    }
Ejemplo n.º 3
0
    private void OnEnable()
    {
        try
        {
            CacheSerializedProperties();
            map     = (OnlineMaps)target;
            control = map.GetComponent <OnlineMapsControlBase>();

            savableItems = map.GetComponents <IOnlineMapsSavableComponent>().SelectMany(c => c.GetSavableItems()).OrderByDescending(s => s.priority).ThenBy(s => s.label).ToList();

            providers      = OnlineMapsProvider.GetProviders();
            providersTitle = providers.Select(p => p.title).ToArray();

            trafficProviders     = OnlineMapsTrafficProvider.GetProviders();
            cTrafficProviders    = trafficProviders.Select(p => new GUIContent(p.title)).ToArray();
            trafficProviderIndex = 0;
            for (int i = 0; i < trafficProviders.Length; i++)
            {
                if (trafficProviders[i].id == pTrafficProviderID.stringValue)
                {
                    trafficProviderIndex = i;
                    break;
                }
            }

            if (pTooltipTexture.objectReferenceValue == null)
            {
                pTooltipTexture.objectReferenceValue = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Textures\\Tooltip.psd");
            }

            updateAvailableContent = new GUIContent("Update Available", OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\update_available.png"), "Update Available");
            wizardIconContent      = new GUIContent(OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\WizardIcon.png"), "Wizard");

            OnlineMapsUpdater.CheckNewVersionAvailable();

            mapType       = OnlineMapsProvider.FindMapType(pMapType.stringValue);
            providerIndex = mapType.provider.index;

            serializedObject.ApplyModifiedProperties();

            map.floatZoom = map.CheckMapSize(map.floatZoom);
        }
        catch (Exception e)
        {
            Debug.Log(e.Message + "\n" + e.StackTrace);
            //throw;
        }
    }
Ejemplo n.º 4
0
    private void OnEnable()
    {
        CacheSerializedProperties();
        api = (OnlineMaps)target;

        providers      = OnlineMapsProvider.GetProviders();
        providersTitle = providers.Select(p => p.title).ToArray();

        if (string.IsNullOrEmpty(pMapType.stringValue))
        {
            pMapType.stringValue = OnlineMapsProvider.Upgrade(pProvider.enumValueIndex, pType.intValue);
        }

        trafficProviders     = OnlineMapsTrafficProvider.GetProviders();
        cTrafficProviders    = trafficProviders.Select(p => new GUIContent(p.title)).ToArray();
        trafficProviderIndex = 0;
        for (int i = 0; i < trafficProviders.Length; i++)
        {
            if (trafficProviders[i].id == pTrafficProviderID.stringValue)
            {
                trafficProviderIndex = i;
                break;
            }
        }

        if (pDefaultMarkerTexture.objectReferenceValue == null)
        {
            pDefaultMarkerTexture.objectReferenceValue = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Textures\\Markers\\DefaultMarker.png");
        }
        if (pTooltipTexture.objectReferenceValue == null)
        {
            pTooltipTexture.objectReferenceValue = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Textures\\Tooltip.psd");
        }

        updateAvailableContent = new GUIContent("Update Available", OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\update_available.png"), "Update Available");
        wizardIconContent      = new GUIContent(OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\WizardIcon.png"), "Wizard");

        OnlineMapsUpdater.CheckNewVersionAvailable();

        mapType       = OnlineMapsProvider.FindMapType(pMapType.stringValue);
        providerIndex = mapType.provider.index;

        serializedObject.ApplyModifiedProperties();
    }
Ejemplo n.º 5
0
    private void OnEnable()
    {
        if (EditorPrefs.HasKey(invoiceNumberKey))
        {
            invoiceNumber = EditorPrefs.GetString(invoiceNumberKey);
        }
        else
        {
            invoiceNumber = "";
        }

        if (EditorPrefs.HasKey(channelKey))
        {
            channel = (OnlineMapsUpdateChannel)EditorPrefs.GetInt(channelKey);
        }
        else
        {
            channel = OnlineMapsUpdateChannel.stable;
        }

        helpContent = new GUIContent(OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons\\HelpIcon.png"), "You can find out your Invoice Number in the email confirming the purchase, or page the user in Unity Asset Store.\nClick to go to the Unity Asset Store.");
    }
Ejemplo n.º 6
0
    protected override void Init()
    {
        Texture2D icon = OnlineMapsEditorUtils.LoadAsset <Texture2D>("Icons/Online-Maps-uContext.png", true);

        _guiContent = new GUIContent(icon, "Online Maps");
    }