public static ServicePrefKey ( string baseKey, string serviceName ) : string | ||
baseKey | string | |
serviceName | string | |
리턴 | string |
public CloudPanelPref(string serviceName) { this.m_ServiceName = serviceName; this.m_CloudPanelServer = UnityConnectPrefs.GetServiceEnv(this.m_ServiceName); this.m_CloudPanelCustomUrl = EditorPrefs.GetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", this.m_ServiceName)); this.m_CloudPanelCustomPort = EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", this.m_ServiceName)); }
public static string FixUrl(string url, string serviceName) { string str1 = url; int serviceEnv = UnityConnectPrefs.GetServiceEnv(serviceName); if (serviceEnv != 0) { if (str1.StartsWith("http://") || str1.StartsWith("https://")) { return(serviceEnv != 3 ? str1.ToLower().Replace("/" + UnityConnectPrefs.kEnvironmentFamilies[0].ToLower() + "/", "/" + UnityConnectPrefs.kEnvironmentFamilies[serviceEnv].ToLower() + "/") : EditorPrefs.GetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", serviceName)) + ":" + (object)EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", serviceName))); } if (str1.StartsWith("file://")) { string str2 = str1.Substring(7); if (serviceEnv == 3) { str2 = EditorPrefs.GetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", serviceName)) + ":" + (object)EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", serviceName)); } return(str2); } if (!str1.StartsWith("file://") && !str1.StartsWith("http://") && !str1.StartsWith("https://")) { return("http://" + str1); } } return(str1); }
public static int GetServiceEnv(string serviceName) { if (Unsupported.IsDeveloperBuild() || UnityConnect.preferencesEnabled) { return(EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelServer", serviceName))); } for (int index = 0; index < UnityConnectPrefs.kEnvironmentFamilies.Length; ++index) { if (UnityConnectPrefs.kEnvironmentFamilies[index].Equals(UnityConnect.instance.configuration, StringComparison.InvariantCultureIgnoreCase)) { return(index); } } return(0); }
public static string FixUrl(string url, string serviceName) { int serviceEnv = UnityConnectPrefs.GetServiceEnv(serviceName); string result; if (serviceEnv != 0) { if (url.StartsWith("http://") || url.StartsWith("https://")) { string text; if (serviceEnv == 3) { string @string = EditorPrefs.GetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", serviceName)); int @int = EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", serviceName)); text = ((@int != 0) ? (@string + ":" + @int) : @string); } else { text = url.ToLower(); text = text.Replace("/" + UnityConnectPrefs.kEnvironmentFamilies[0].ToLower() + "/", "/" + UnityConnectPrefs.kEnvironmentFamilies[serviceEnv].ToLower() + "/"); } result = text; return(result); } if (url.StartsWith("file://")) { string text = url.Substring(7); if (serviceEnv == 3) { string string2 = EditorPrefs.GetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", serviceName)); int int2 = EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", serviceName)); text = string2 + ":" + int2; } result = text; return(result); } if (!url.StartsWith("file://") && !url.StartsWith("http://") && !url.StartsWith("https://")) { string text = "http://" + url; result = text; return(result); } } result = url; return(result); }
public static int GetServiceEnv(string serviceName) { int result; if (Unsupported.IsDeveloperBuild() || UnityConnect.preferencesEnabled) { result = EditorPrefs.GetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelServer", serviceName)); } else { for (int i = 0; i < UnityConnectPrefs.kEnvironmentFamilies.Length; i++) { string text = UnityConnectPrefs.kEnvironmentFamilies[i]; if (text.Equals(UnityConnect.instance.configuration, StringComparison.InvariantCultureIgnoreCase)) { result = i; return(result); } } result = 0; } return(result); }
public void StoreCloudServicePref() { EditorPrefs.SetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelServer", this.m_ServiceName), this.m_CloudPanelServer); EditorPrefs.SetString(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomUrl", this.m_ServiceName), this.m_CloudPanelCustomUrl); EditorPrefs.SetInt(UnityConnectPrefs.ServicePrefKey("CloudPanelCustomPort", this.m_ServiceName), this.m_CloudPanelCustomPort); }