static void InitializeOnLoad() { if (EditorUserSettings.GetConfigValue("Opened") != "1" || (check && EditorUserSettings.GetConfigValue("VRMCheckCaution") != "1")) { Open(); } }
static void InitializeOnLoad() { if (EditorUserSettings.GetConfigValue("Opened") != "1") { Open(); } }
void OnEnable() { _targets = Selection.objects.ToList(); string path = EditorUserSettings.GetConfigValue(Key_LastFolderPath); _folder = AssetDatabase.LoadAssetAtPath <DefaultAsset>(path); }
//================================================================================ // 関数(static) //================================================================================ /// <summary> /// 設定から読み込みます /// </summary> public static TimeEntities LoadFromConfig() { var value = EditorUserSettings.GetConfigValue(KEY); var entities = JsonUtility.FromJson <TimeEntities>(value) ?? new TimeEntities(); return(entities); }
static UseLocalDataSettingStartup() { var str = EditorUserSettings.GetConfigValue("UseLocalDataSettingWindow_SelectDLCType"); if (string.IsNullOrEmpty(str)) { return; } int SelectDLCType = 0; if (!int.TryParse(str, out SelectDLCType)) { SelectDLCType = 0; } if (SelectDLCType == 0) { var symbols = "DEFINE_DEVELOP;"; PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, symbols); } else if (SelectDLCType == 1) { var symbols = "DEFINE_DEVELOP;USE_LOCAL_DATA;"; PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, symbols); } }
void OnGUI() { int enabledCount = 0; for (Directories i0 = 0; i0 < Directories.Count; ++i0) { string key = $"{GetType()}#{i0}"; string value = EditorUserSettings.GetConfigValue(key); bool setting; if (bool.TryParse(value, out setting) == false) { setting = false; } bool enabled = EditorGUILayout.ToggleLeft(i0.ToString(), setting); if (setting != enabled) { EditorUserSettings.SetConfigValue(key, enabled.ToString()); } if (enabled != false) { ++enabledCount; } } EditorGUI.BeginDisabledGroup(enabledCount == 0); { if (GUILayout.Button("Create") != false) { MenuOptions.CreateSelections(); Close(); } } EditorGUI.EndDisabledGroup(); }
public static string SaveFilePanel(string Title, string defaultName, string extension) { EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); string savePath = EditorGUILayout.TextField(Title, EditorUserSettings.GetConfigValue(Title)); if (EditorGUI.EndChangeCheck()) { EditorUserSettings.SetConfigValue(Title, savePath); } if (!Directory.Exists(savePath)) { savePath = Application.dataPath; EditorUserSettings.SetConfigValue(Title, savePath); } if (GUILayout.Button("browser", GUILayout.Width(80))) { string raw = EditorUtility.SaveFilePanel(Title, savePath, defaultName, extension); if (!string.IsNullOrEmpty(raw) && raw != savePath) { savePath = raw; EditorUserSettings.SetConfigValue(Title, savePath); GUI.FocusControl(""); } } EditorGUILayout.EndHorizontal(); return(savePath); }
public static string OpenFolderPannel(string Title, string defaultName = "") { EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); string OpenDir = EditorGUILayout.TextField(Title, EditorUserSettings.GetConfigValue(Title)); if (EditorGUI.EndChangeCheck()) { EditorUserSettings.SetConfigValue(Title, OpenDir); } if (!Directory.Exists(OpenDir)) { OpenDir = Application.dataPath; EditorUserSettings.SetConfigValue(Title, OpenDir); } if (GUILayout.Button("browser", GUILayout.Width(80))) { string raw = EditorUtility.OpenFolderPanel(Title, OpenDir, defaultName); if (!string.IsNullOrEmpty(raw) && raw != OpenDir) { OpenDir = raw; EditorUserSettings.SetConfigValue(Title, OpenDir); GUI.FocusControl(""); } } EditorGUILayout.EndHorizontal(); return(OpenDir); }
private void OnEnable() { if (string.IsNullOrEmpty(_releaseParameter.BranchName)) { _releaseParameter.BranchName = EditorUserSettings.GetConfigValue(GetSaveKey(SaveKeyType.Branch)); } if (string.IsNullOrEmpty(_releaseParameter.TagName)) { _releaseParameter.TagName = EditorUserSettings.GetConfigValue(GetSaveKey(SaveKeyType.TagName)); } if (string.IsNullOrEmpty(_releaseParameter.UserName)) { _releaseParameter.UserName = EditorUserSettings.GetConfigValue(GetSaveKey(SaveKeyType.UserName)); } if (string.IsNullOrEmpty(_releaseParameter.TokenValue)) { _releaseParameter.TokenValue = EditorUserSettings.GetConfigValue(GetSaveKey(SaveKeyType.Token)); } if (_releaseSetting == null) { _releaseSetting = Utility.FindAssetFromType <ReleaseExecutorSetting>(); _releaseSettingEditor = Editor.CreateEditor(_releaseSetting); } }
private static void SaveClothParam(ClothParams clothParam) { // フォルダを読み込み string folder = EditorUserSettings.GetConfigValue(configName); // 保存ダイアログ string path = UnityEditor.EditorUtility.SaveFilePanelInProject( "Save Preset", "preset", "json", "Enter a name for the preset json.", folder ); if (string.IsNullOrEmpty(path)) { return; } // フォルダを記録 folder = Path.GetDirectoryName(path); EditorUserSettings.SetConfigValue(configName, folder); Debug.Log("Save preset file:" + path); // json string json = JsonUtility.ToJson(clothParam); // save File.WriteAllText(path, json); AssetDatabase.Refresh(); Debug.Log("Complete."); }
/// <summary> /// アバターごとの変換設定を記録したXML文書を返します。 /// </summary> /// <returns>まだ何も保存されていない場合、またはXMLパースエラーが発生した場合は、ルート要素のみ存在する文書を返します。</returns> private XmlDocument GetSettingsList() { var defaultDocument = new XmlDocument(); defaultDocument.AppendChild(defaultDocument.CreateElement(qualifiedName: "list", namespaceURI: Wizard.EditorUserSettingsXmlNamespace)); string configValue = EditorUserSettings.GetConfigValue(Wizard.EditorUserSettingsName); if (string.IsNullOrEmpty(configValue)) { return(defaultDocument); } var document = new XmlDocument(); try { document.LoadXml(xml: configValue); } catch (XmlException) { return(defaultDocument); } return(document); }
static void AddAssetToAddressable(string assetPath) { //只将Assets/AssetsPackage目录下的资源挂addressable if (!assetPath.Contains("Assets/" + AddressableTools.Assets_Package)) { return; } if (Directory.Exists(assetPath)) { return; } if (assetPath.Contains("Atlas"))//图集 { string is_atlas_model = EditorUserSettings.GetConfigValue(AddressableTools.is_atlas_model); if (is_atlas_model == "0") { AddressableTools.AddImportAssetToaddressable(assetPath); } } else { AddressableTools.AddImportAssetToaddressable(assetPath); } }
static void _init() { CurrentEEVOConfig = AssetDatabase.LoadAssetAtPath <EEVOConfig>(EditorUserSettings.GetConfigValue(PathKey)); CompilationPipeline.compilationStarted += o => { _compileErrorCount = 0; PlayClip(CurrentEEVOConfig.CompileStart_Clip); }; CompilationPipeline.assemblyCompilationFinished += (s, messages) => { _compileErrorCount += messages.Count(x => x.type == CompilerMessageType.Error); }; CompilationPipeline.compilationFinished += o => { if (_compileErrorCount > 0) { PlayClip(CurrentEEVOConfig.CompileCompleteButExistError_Clip); } else { PlayClip(CurrentEEVOConfig.CompileComplete_Clip); } }; EditorApplication.quitting += () => { PlayClip(CurrentEEVOConfig.CloseUnityEditor_Clip); }; }
//Called in Sync() protected override IEnumerator Pull(Action <List <Task> > callback) { #if UNITY_EDITOR trelloToken = EditorUserSettings.GetConfigValue(Trello.KEY_TOKEN); trelloBoardId = EditorUserSettings.GetConfigValue(Trello.KEY_BOARD); #endif WWW www = new WWW(string.Format(APIURL_CARDS, listId, Trello.APIKEY, trelloToken)); yield return(www); if (!string.IsNullOrEmpty(www.error)) { Debug.Log(www.error); callback(null); } else if (!string.IsNullOrEmpty(www.text)) { Debug.Log(www.text); IList json = (IList)MiniJSON.Json.Deserialize(www.text); List <Task> l = new List <Task> (); foreach (IDictionary b in json) { Task t = Trello.TrelloCardToTask(b); l.Add(t); } //l.Add (new Task ("hogehoge", new Vector3 (1, 0, 1), "ちくわ大明神", "ちくわ", "https://wararyo.com")); //l.Add (new Task ("piyopiyo", new Vector3 (10, 0, 10), "私たちはここにいます\nここには夢がちゃんとある", "わーい", "https://wararyo.com")); callback(l); } }
public static bool OnOpenAsset3(int instanceID, int line) { string luaFolderRoot = EditorUserSettings.GetConfigValue(LUA_PROJECT_ROOT_FOLDER_PATH_KEY); if (string.IsNullOrEmpty(luaFolderRoot)) { SetLuaProjectRoot(); luaFolderRoot = EditorUserSettings.GetConfigValue(LUA_PROJECT_ROOT_FOLDER_PATH_KEY); } string filePath; int luaLine; string logText = GetLogText(); string startIndex = "LuaException: "; if (string.IsNullOrEmpty(logText) || logText.IndexOf(startIndex) == -1) { return(false); } int si = logText.LastIndexOf(startIndex) + startIndex.Length; logText = logText.Substring(si, logText.Length - si); logText = logText.Substring(0, logText.IndexOf(": ")); filePath = logText.Split(':')[0]; filePath = filePath.Replace(".", "/") + ".lua"; luaLine = int.Parse(logText.Split(':')[1]); filePath = GetAsset(luaFolderRoot, Path.GetFileNameWithoutExtension(filePath)); filePath = filePath.Replace("\\", "/"); return(OpenFileAtLineExternal(filePath, luaLine)); }
private static void CheckVersion() { if (EditorApplication.isPlayingOrWillChangePlaymode) { return; } // ローカルバージョンを確認 Debug.Log("[Arktoon] Checking local version."); string localVersion = EditorUserSettings.GetConfigValue("arktoon_version_local") ?? ""; if (!localVersion.Equals(version)) { // Arktoonが更新または新規にインストールされているので、既存のマテリアルの更新を行う。 ArktoonMigrator.Migrate(); } // ローカルバージョンをセット EditorUserSettings.SetConfigValue("arktoon_version_local", version); // リモート(githubのpublic release)のバージョンを取得 Debug.Log("[Arktoon] Checking remote version."); www = UnityWebRequest.Get(url); #if UNITY_2017_OR_NEWER www.SendWebRequest(); #else #pragma warning disable 0618 www.Send(); #pragma warning restore 0618 #endif EditorApplication.update += EditorUpdate; }
void ApplySerializewindowLayouts(PostLayoutEvent evt) { UnregisterCallback <PostLayoutEvent>(ApplySerializewindowLayouts); m_FloatingWindowsLayoutKey = "UnityEditor.ShaderGraph.FloatingWindowsLayout"; string serializedWindowLayout = EditorUserSettings.GetConfigValue(m_FloatingWindowsLayoutKey); if (!String.IsNullOrEmpty(serializedWindowLayout)) { m_FloatingWindowsLayout = JsonUtility.FromJson <FloatingWindowsLayout>(serializedWindowLayout); m_FloatingWindowsLayout.defaultPreviewLayout.CalculateDockingCornerAndOffset(m_MasterPreviewView.layout, layout); m_FloatingWindowsLayout.defaultBlackboardLayout.CalculateDockingCornerAndOffset(m_BlackboardProvider.blackboard.layout, layout); m_MasterPreviewView.layout = m_FloatingWindowsLayout.previewLayout.GetLayout(layout); m_BlackboardProvider.blackboard.layout = m_FloatingWindowsLayout.blackboardLayout.GetLayout(layout); m_MasterPreviewView.UpdateRenderTextureOnNextLayoutChange(); } else { m_FloatingWindowsLayout = new FloatingWindowsLayout(); m_FloatingWindowsLayout.defaultPreviewLayout.CalculateDockingCornerAndOffset(m_MasterPreviewView.layout, layout); m_FloatingWindowsLayout.defaultBlackboardLayout.CalculateDockingCornerAndOffset(m_BlackboardProvider.blackboard.layout, layout); } }
public static void DisplayVersion() { EditorGUILayout.LabelField("Local Version: " + EditorUserSettings.GetConfigValue(localver)); EditorGUILayout.LabelField("Remote Version: " + EditorUserSettings.GetConfigValue(remotever)); if (bool.TryParse(EditorUserSettings.GetConfigValue(needUpdate), out bool needupdate) && needupdate) { using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { EditorGUILayout.LabelField("Update", EditorStyles.boldLabel); using (new EditorGUILayout.HorizontalScope()) { if (GUILayout.Button(UIText.btnGithub)) { UIHelper.OpenLink(URL.GITHUB_RELEASE); } if (GUILayout.Button(UIText.btnBooth)) { UIHelper.OpenLink(URL.BOOTH_PAGE); } if (GUILayout.Button(UIText.btnVket)) { UIHelper.OpenLink(URL.VKET_PAGE); } } } } }
/// <summary> /// プリセットファイル読み込み /// </summary> /// <param name="owner"></param> /// <param name="clothParam"></param> private static void LoadPreset(MonoBehaviour owner, ClothParams clothParam) { // フォルダを読み込み string folder = EditorUserSettings.GetConfigValue(configName); // 読み込みダイアログ string path = UnityEditor.EditorUtility.OpenFilePanel("Load Preset", folder, "json"); if (string.IsNullOrEmpty(path)) { return; } // フォルダを記録 folder = Path.GetDirectoryName(path); EditorUserSettings.SetConfigValue(configName, folder); // json Debug.Log("Load preset file:" + path); string json = File.ReadAllText(path); // load LoadClothParam(owner, clothParam, json); Debug.Log("Complete."); }
public void LoadConfig() { string configtext = EditorUserSettings.GetConfigValue("MapDesignerConfig"); this.brushes = JsonConvert.DeserializeObject <List <BlockBrush> >(configtext); Debug.Log("Load Config"); }
public static void Test() { Debug.Log("old:" + EditorUserBuildSettings.GetPlatformSettings("", "metroPackageVersion")); Debug.Log("Test:" + EditorPrefs.GetString("metroPackageVersion")); Debug.Log(";;:" + EditorUserSettings.GetConfigValue("metroPackageVersion")); }
public static bool OnOpenAsset2(int instanceID, int line) { string logText = GetLogText(); // get filePath Regex regex = new Regex(@"<filePath>.*<\/filePath>"); Match match = regex.Match(logText); string filePath = match.Groups[0].Value.Trim(); int length = filePath.Length - 10 - 12; filePath = filePath.Substring(10, length); filePath = filePath.Replace(".", "/"); string luaFolderRoot = EditorUserSettings.GetConfigValue(LUA_PROJECT_ROOT_FOLDER_PATH_KEY); if (string.IsNullOrEmpty(luaFolderRoot)) { SetLuaProjectRoot(); luaFolderRoot = EditorUserSettings.GetConfigValue(LUA_PROJECT_ROOT_FOLDER_PATH_KEY); } filePath = luaFolderRoot.Trim() + "/" + filePath.Trim() + ".lua"; // get line number Regex lineRegex = new Regex(@"<line>.*<\/line>"); match = lineRegex.Match(logText); string luaLineString = match.Groups[0].Value; luaLineString.Trim(); length = luaLineString.Length - 6 - 11; luaLineString = luaLineString.Substring(10, length); int luaLine = int.Parse(luaLineString.Trim()); return(OpenFileAtLineExternal(filePath, luaLine)); }
static bool OpenFileWith(string filepath, int line, int column) { string editorPath = EditorUserSettings.GetConfigValue(EDITOR_PATH); if (string.IsNullOrEmpty(editorPath) || !File.Exists(editorPath)) { SetEditorPath(); editorPath = EditorUserSettings.GetConfigValue(EDITOR_PATH); if (string.IsNullOrEmpty(editorPath)) { return(false); } } string projectPath = EditorUserSettings.GetConfigValue(PROJECT_PATH); if (string.IsNullOrEmpty(projectPath) || !Directory.Exists(projectPath)) { SetProjectPath(); projectPath = EditorUserSettings.GetConfigValue(PROJECT_PATH); if (string.IsNullOrEmpty(projectPath)) { return(false); } } //默认为VScode的启动参数 var args = string.Format("\"{0}\" -g \"{1}\":{2}:{3}", projectPath, filepath, line, column); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = editorPath; proc.StartInfo.Arguments = args; proc.Start(); return(true); }
private static void CheckVersion() { if (EditorApplication.isPlayingOrWillChangePlaymode) { return; } int.TryParse(version.Substring(1), out int verint); versionInt = verint * 100; // Check Local Version string localVersion = EditorUserSettings.GetConfigValue(localver) ?? ""; if (!localVersion.Equals(version)) { // Update Materiams //ArktoonMigrator.Migrate(); } // Set Local Version EditorUserSettings.SetConfigValue(localver, version); // Get Remote Version www = UnityWebRequest.Get(URL.GITHUB_VERCHECK); #if UNITY_2017_OR_NEWER www.SendWebRequest(); #else #pragma warning disable 0618 www.Send(); #pragma warning restore 0618 #endif EditorApplication.update += EditorUpdate; EditorUserSettings.SetConfigValue(needUpdate, NeedUpdate().ToString()); }
static void CheckVersion() { if (EditorApplication.isPlayingOrWillChangePlaymode) { return; } Debug.Log("[Arktoon] Checking local version."); string localVersion = EditorUserSettings.GetConfigValue("arktoon_version_local") ?? ""; if (!localVersion.Equals(version)) { // 直前のバージョンと異なるか新規インポートなので、とりあえずReimportを走らせる Debug.Log("[Arktoon] Version change detected : Force reimport."); string guidArktoonManager = AssetDatabase.FindAssets("ArktoonManager t:script")[0]; string pathToArktoonManager = AssetDatabase.GUIDToAssetPath(guidArktoonManager); string pathToShaderDir = Directory.GetParent(Path.GetDirectoryName(pathToArktoonManager)) + "/Shaders"; AssetDatabase.ImportAsset(pathToShaderDir, ImportAssetOptions.ForceUpdate | ImportAssetOptions.ImportRecursive); } // 更新後ローカルバージョンをセット EditorUserSettings.SetConfigValue("arktoon_version_local", version); Debug.Log("[Arktoon] Checking remote version."); www = UnityWebRequest.Get(url); #if UNITY_2017_OR_NEWER www.SendWebRequest(); #else #pragma warning disable 0618 www.Send(); #pragma warning restore 0618 #endif EditorApplication.update += EditorUpdate; }
public static int GetCurrentMigrationVersion() { if (int.TryParse(EditorUserSettings.GetConfigValue(KEY_MIG_VERSION) ?? "0", out var version)) { return(version); } return(0); }
void OnEnable() { pattern = EditorUserSettings.GetConfigValue("CopyComponentsByRegex/pattern") ?? ""; isRemoveBeforeCopy = bool.Parse(EditorUserSettings.GetConfigValue("CopyComponentsByRegex/isRemoveBeforeCopy") ?? isRemoveBeforeCopy.ToString()); isObjectCopy = bool.Parse(EditorUserSettings.GetConfigValue("CopyComponentsByRegex/isObjectCopy") ?? isObjectCopy.ToString()); isClothNNS = bool.Parse(EditorUserSettings.GetConfigValue("CopyComponentsByRegex/isClothNNS") ?? isClothNNS.ToString()); copyTransform = bool.Parse(EditorUserSettings.GetConfigValue("CopyComponentsByRegex/copyTransform") ?? copyTransform.ToString()); }
static void OpenFileWith(string fileName, int line) { string editorPath = EditorUserSettings.GetConfigValue(EXTERNAL_EDITOR_PATH_KEY); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = editorPath; proc.StartInfo.Arguments = string.Format("{0}:{1}:0", fileName, line); proc.Start(); }
static void OpenFileAtLineExternal(string fileName, int line) { string editorPath = EditorUserSettings.GetConfigValue(EXTERNAL_EDITOR_PATH_KEY); if (string.IsNullOrEmpty(editorPath) || !File.Exists(editorPath)) { // 没有path就弹出面板设置 SetExternalEditorPath(); } OpenFileWith(fileName, line); }
static void OpenFileWith(string fileName, int line) { string editorPath = EditorUserSettings.GetConfigValue(EXTERNAL_EDITOR_PATH_KEY); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = editorPath; proc.StartInfo.Arguments = string.Format("{0} --line {1} {2}", EditorUserSettings.GetConfigValue(LUA_PROJECT_ROOT_FOLDER_PATH_KEY), line, fileName); proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized; proc.Start(); }