private void EnsureDrawerIsVisible(bool forceFocus)
        {
            if ((s_UnityConnectEditorWindow == null) || !s_UnityConnectEditorWindow.UrlsMatch(this.GetAllServiceUrls()))
            {
                string title      = "Services";
                int    serviceEnv = UnityConnectPrefs.GetServiceEnv(this.m_CurrentServiceName);
                if (serviceEnv != 0)
                {
                    title = title + " [" + UnityConnectPrefs.kEnvironmentFamilies[serviceEnv] + "]";
                }
                s_UnityConnectEditorWindow          = UnityConnectEditorWindow.Create(title, this.GetAllServiceUrls());
                s_UnityConnectEditorWindow.ErrorUrl = this.m_Services["ErrorHub"].serviceUrl;
                s_UnityConnectEditorWindow.minSize  = new Vector2(275f, 50f);
            }
            string serviceUrl = this.m_Services[this.m_CurrentServiceName].serviceUrl;

            if (this.m_CurrentPageName.Length > 0)
            {
                serviceUrl = serviceUrl + "/#/" + this.m_CurrentPageName;
            }
            s_UnityConnectEditorWindow.currentUrl = serviceUrl;
            s_UnityConnectEditorWindow.ShowTab();
            if (InternalEditorUtility.isApplicationActive && forceFocus)
            {
                s_UnityConnectEditorWindow.Focus();
            }
        }
Esempio n. 2
0
        private void EnsureDrawerIsVisible(bool forceFocus)
        {
            //Create the container in case it doesnt exist
            if (s_UnityConnectEditorWindow == null || !s_UnityConnectEditorWindow.UrlsMatch(GetAllServiceUrls()))
            {
                var fixTitle = kDrawerContainerTitle;

                var panelEnv = UnityConnectPrefs.GetServiceEnv(m_CurrentServiceName);
                if (panelEnv != UnityConnectPrefs.kProductionEnv)
                {
                    fixTitle += " [" + UnityConnectPrefs.kEnvironmentFamilies[panelEnv] + "]";
                }

                s_UnityConnectEditorWindow          = UnityConnectEditorWindow.Create(fixTitle, GetAllServiceUrls());
                s_UnityConnectEditorWindow.ErrorUrl = m_Services[ErrorHubAccess.kServiceName].serviceUrl;
                s_UnityConnectEditorWindow.minSize  = new Vector2(275, 50);
            }
            //Since s_UnityConnectEditorWindow.currentUrl is a property that load a page we must build the url before changing it
            var newUrl = m_Services[m_CurrentServiceName].serviceUrl;

            if (m_CurrentPageName.Length > 0)
            {
                newUrl += ("/#/" + m_CurrentPageName);
            }
            s_UnityConnectEditorWindow.currentUrl = newUrl;
            s_UnityConnectEditorWindow.ShowTab();

            if (InternalEditorUtility.isApplicationActive && forceFocus)
            {
                s_UnityConnectEditorWindow.Focus();
            }
        }