private void ClearConfig() { if (EditorUtility.DisplayDialog("Clear Configuration", "Are you sure you want to disconnect from Asset Server project and clear all configuration values?", "Clear", "Cancel")) { this.plc = new PListConfig("Library/ServerPreferences.plist"); this.plc.Clear(); this.plc.Save(); this.LoadConfig(); this.projectsLv.totalRows = 0; ASEditorBackend.InitializeMaintBinding(); this.resetKeyboardControl = true; } }
private void DoConnect() { AssetServer.RemoveMaintErrorsFromConsole(); int result = 0x29ed; string serverAddress = this.serverAddress; if (serverAddress.IndexOf(":") > 0) { int.TryParse(serverAddress.Substring(serverAddress.IndexOf(":") + 1), out result); serverAddress = serverAddress.Substring(0, serverAddress.IndexOf(":")); } this.port = result.ToString(); string str2 = AssetServer.GetDatabaseName(serverAddress, this.userName, this.password, this.port, this.projectName); this.GetDefaultPListConfig(); this.plc["Maint Server"] = serverAddress; this.plc["Maint UserName"] = this.userName; this.plc["Maint database name"] = str2; this.plc["Maint port number"] = this.port; this.plc["Maint project name"] = this.projectName; this.plc.Save(); if (ArrayUtility.Contains <string>(this.serversList, this.serverAddress)) { ArrayUtility.Remove <string>(ref this.serversList, this.serverAddress); } ArrayUtility.Insert <string>(ref this.serversList, 0, this.serverAddress); ASEditorBackend.AddUser(this.serverAddress, this.userName); ASEditorBackend.SetPassword(this.serverAddress, this.userName, this.password); InternalEditorUtility.SaveEditorSettingsList("ASServer", this.serversList, 20); if (str2 != string.Empty) { ASEditorBackend.InitializeMaintBinding(); this.parentWin.Reinit(); GUIUtility.ExitGUI(); } else { this.parentWin.NeedsSetup = true; this.parentWin.Repaint(); } }
public static bool SettingsIfNeeded() { return(ASEditorBackend.InitializeMaintBinding()); }