GetPanelPref() protected static method

protected static GetPanelPref ( string serviceName ) : CloudPanelPref
serviceName string
return CloudPanelPref
Exemplo n.º 1
0
        public static void ShowPanelPrefUI()
        {
            List <string> allServiceNames = UnityConnectServiceCollection.instance.GetAllServiceNames();
            bool          flag            = false;

            using (List <string> .Enumerator enumerator = allServiceNames.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    UnityConnectPrefs.CloudPanelPref panelPref = UnityConnectPrefs.GetPanelPref(current);
                    int result = EditorGUILayout.Popup(current, panelPref.m_CloudPanelServer, UnityConnectPrefs.kEnvironmentFamilies, new GUILayoutOption[0]);
                    if (result != panelPref.m_CloudPanelServer)
                    {
                        panelPref.m_CloudPanelServer = result;
                        flag = true;
                    }
                    if (panelPref.m_CloudPanelServer == 3)
                    {
                        ++EditorGUI.indentLevel;
                        string str = EditorGUILayout.TextField("Custom server URL", panelPref.m_CloudPanelCustomUrl, new GUILayoutOption[0]);
                        if (str != panelPref.m_CloudPanelCustomUrl)
                        {
                            panelPref.m_CloudPanelCustomUrl = str;
                            flag = true;
                        }
                        int.TryParse(EditorGUILayout.TextField("Custom server port", panelPref.m_CloudPanelCustomPort.ToString(), new GUILayoutOption[0]), out result);
                        if (result != panelPref.m_CloudPanelCustomPort)
                        {
                            panelPref.m_CloudPanelCustomPort = result;
                            flag = true;
                        }
                        --EditorGUI.indentLevel;
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            UnityConnectServiceCollection.instance.ReloadServices();
        }
        public static void ShowPanelPrefUI()
        {
            List <string> allServiceNames = UnityConnectServiceCollection.instance.GetAllServiceNames();
            bool          flag            = false;

            foreach (string current in allServiceNames)
            {
                UnityConnectPrefs.CloudPanelPref panelPref = UnityConnectPrefs.GetPanelPref(current);
                int num = EditorGUILayout.Popup(current, panelPref.m_CloudPanelServer, UnityConnectPrefs.kEnvironmentFamilies, new GUILayoutOption[0]);
                if (num != panelPref.m_CloudPanelServer)
                {
                    panelPref.m_CloudPanelServer = num;
                    flag = true;
                }
                if (panelPref.m_CloudPanelServer == 3)
                {
                    EditorGUI.indentLevel++;
                    string text = EditorGUILayout.TextField("Custom server URL", panelPref.m_CloudPanelCustomUrl, new GUILayoutOption[0]);
                    if (text != panelPref.m_CloudPanelCustomUrl)
                    {
                        panelPref.m_CloudPanelCustomUrl = text;
                        flag = true;
                    }
                    int.TryParse(EditorGUILayout.TextField("Custom server port", panelPref.m_CloudPanelCustomPort.ToString(), new GUILayoutOption[0]), out num);
                    if (num != panelPref.m_CloudPanelCustomPort)
                    {
                        panelPref.m_CloudPanelCustomPort = num;
                        flag = true;
                    }
                    EditorGUI.indentLevel--;
                }
            }
            if (flag)
            {
                UnityConnectServiceCollection.instance.ReloadServices();
            }
        }