protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); DrawConfig(); EditorGUILayout.Space(); DrawButton(); EditorGUILayout.Space(); DrawPreview(); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); if (GUILayout.Button("Refresh")) { RefreshGuid(); } EditorGUILayout.PrefixLabel("System Guid"); EditorGUILayout.TextArea(systemGuid.ToString()); EditorGUILayout.PrefixLabel("Unity Guid"); EditorGUILayout.TextArea(unityGuid.ToString()); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); for (int i = 0; i < texts.Length; i++) { Text text = texts[i]; EditorGUILayout.BeginHorizontal(); GUI.enabled = false; EditorGUILayout.ObjectField(text.gameObject, typeof(GameObject), true); GUI.enabled = true; text.font = (Font)EditorGUILayout.ObjectField(text.font, typeof(Font), true); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndScrollView(); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); EditorGUILayout.LabelField("Input", EditorStyles.boldLabel); inputString = EditorGUILayout.TextArea(inputString, GUILayout.MinHeight(height)); EditorGUILayout.LabelField("Regex", EditorStyles.boldLabel); regexString = EditorGUILayout.TextArea(regexString, GUILayout.MinHeight(height)); EditorGUILayout.LabelField("Matches", EditorStyles.boldLabel); try { if (string.IsNullOrEmpty(regexString)) { return; } foreach (Match match in Regex.Matches(inputString, regexString)) { #if UNITY_2018_1_OR_NEWER EditorGUILayout.LabelField(string.Format("Match:\tIndex: {0}\tName: {1}\tValue: {2}", match.Index, match.Name, match.Value)); #else EditorGUILayout.LabelField(string.Format("Match:\tIndex: {0}\tValue: {1}", match.Index, match.Value)); #endif EditorGUI.indentLevel++; foreach (Group group in match.Groups) { #if UNITY_2018_1_OR_NEWER EditorGUILayout.LabelField(string.Format("Group:\tIndex: {0}\tName: {1}\tValue: {2}", group.Index, group.Name, group.Value)); #else EditorGUILayout.LabelField(string.Format("Group:\tIndex: {0}\tValue: {1}", group.Index, group.Value)); #endif EditorGUI.indentLevel++; foreach (Capture capture in group.Captures) { EditorGUILayout.LabelField(string.Format("Capture:\tIndex: {0}\tValue: {1}", capture.Index, capture.Value)); } EditorGUI.indentLevel--; } EditorGUI.indentLevel--; } } catch { } }
private void OnGUI() { EZEditorGUIUtility.WindowTitle(this as EditorWindow); EditorGUILayout.LabelField("Factors", EditorStyles.boldLabel); useHDR = EditorGUILayout.Toggle("Use HDR", useHDR); { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Source Color"); EditorGUILayout.LabelField("Destination Color"); EditorGUILayout.EndHorizontal(); } { EditorGUILayout.BeginHorizontal(); srcColor = EditorGUILayout.ColorField(GUIContent.none, srcColor); dstColor = EditorGUILayout.ColorField(GUIContent.none, dstColor); EditorGUILayout.EndHorizontal(); } { EditorGUILayout.BeginHorizontal(); EditorGUILayout.EndHorizontal(); } float width = Mathf.Max(50, EditorGUIUtility.currentViewWidth / 4 - 5); EditorGUILayout.Space(); EditorGUILayout.LabelField("Results", EditorStyles.boldLabel); DrawResultsSingleLine(width, "Add", "Minus", "Multiply", "Divide"); DrawResultsSingleLine(width, "Opacity", "Darken", "Lighten", "Screen"); DrawResultsSingleLine(width, "ColorBurn", "ColorDodge", "LinearBurn", "LinearDodge"); DrawResultsSingleLine(width, "Overlay", "HardLight", "SoftLight", "VividLight"); DrawResultsSingleLine(width, "LinearLight", "PinLight", "HardMix", "Difference"); DrawResultsSingleLine(width, "Exclusion"); DrawResultsSingleLine(width, "HSVBlend_H", "HSVBlend_S", "HSVBlend_V", "HSVBlend_HS"); if (GUI.changed) { CalculateAll(); } }
private void OnGUI() { EZEditorGUIUtility.WindowTitle(this); EditorGUILayout.ObjectField("Target", target, typeof(Object), false); EditorGUILayout.EnumPopup("Prefab Asset Type", prefabAssetType); EditorGUILayout.ObjectField("Original Object", originalObject, typeof(Object), false); correspondingObjectsFoldout = EditorGUILayout.Foldout(correspondingObjectsFoldout, "Corresponding Objects"); if (correspondingObjectsFoldout) { EditorGUI.indentLevel++; for (int i = 0; i < correspondingObjects.Count; i++) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.ObjectField(i.ToString("00"), correspondingObjects[i], typeof(Object), false); float width = (EditorGUIUtility.currentViewWidth - EditorGUIUtility.labelWidth) / 2; EditorGUILayout.ObjectField(correspondingAssets[i], typeof(Object), false, GUILayout.Width(width)); EditorGUILayout.EndHorizontal(); } EditorGUI.indentLevel--; } }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); EditorGUILayout.ObjectField("Target", target, typeof(Object), true); EditorGUILayout.BeginHorizontal(); if (dependenciesRecursive != EditorGUILayout.Toggle("Show Recursive Dependencies", dependenciesRecursive)) { dependenciesRecursive = !dependenciesRecursive; Refresh(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); if (dependenciesFoldout = EditorGUILayout.Foldout(dependenciesFoldout, "Asset Dependencies")) { EditorGUI.indentLevel++; for (int i = 0; i < dependencies.Count; i++) { if (dependencies[i] == target) { continue; // dependencies contains target itself } EditorGUILayout.ObjectField(dependencies[i], typeof(Object), true); } EditorGUI.indentLevel--; } if (referencesFoldout = EditorGUILayout.Foldout(referencesFoldout, "Scene References")) { EditorGUI.indentLevel++; foreach (Object obj in sceneReferences) { EditorGUILayout.ObjectField(obj, typeof(Object), true); } EditorGUI.indentLevel--; } EditorGUILayout.EndScrollView(); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); Material selection = Selection.activeObject as Material; EditorGUILayout.Space(); if (selection != null) { EditorGUILayout.ObjectField("Selection", selection, typeof(Material), true); EditorGUI.indentLevel++; for (int i = 0; i < selection.shaderKeywords.Length; i++) { string keyword = selection.shaderKeywords[i]; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(keyword); if (GUILayout.Button("Delete")) { selection.DisableKeyword(keyword); EditorUtility.SetDirty(selection); } EditorGUILayout.EndHorizontal(); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } if (GUILayout.Button("Get All Keywords")) { GetAllMaterials(); GetAllKeywordRenderence(); } scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); bool changed = false; int index = 0; foreach (var pair in keywordReference) { EditorGUILayout.BeginHorizontal(); keywordFoldout[pair.Key] = EditorGUILayout.Foldout(keywordFoldout[pair.Key], index++.ToString("00 ") + pair.Key); if (GUILayout.Button("Delete")) { foreach (Material mat in pair.Value) { mat.DisableKeyword(pair.Key); EditorUtility.SetDirty(mat); } changed = true; } EditorGUILayout.EndHorizontal(); if (keywordFoldout[pair.Key]) { EditorGUI.indentLevel++; foreach (Material mat in pair.Value) { EditorGUILayout.ObjectField(mat, typeof(Material), true); } EditorGUI.indentLevel--; } } if (changed) { GetAllKeywordRenderence(); } EditorGUILayout.EndScrollView(); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); #if UNITY_EDITOR_WIN && NET_STANDARD_2_0 EditorGUILayout.HelpBox("Api Compatibility Level Not Supported", MessageType.Error); #elif UNITY_EDITOR_WIN if (GUILayout.Button("Refresh")) { Refresh(); } EditorGUILayout.Space(); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); for (int i = 0; i < pairList.Count; i++) { EditorGUILayout.BeginHorizontal(); string key = pairList[i].key; ValueType type = pairList[i].type; if (type == ValueType.String) { EditorGUILayout.LabelField("string", new GUILayoutOption[] { GUILayout.Width(40), }); string input = EditorGUILayout.DelayedTextField(key, PlayerPrefs.GetString(key)); if (input != PlayerPrefs.GetString(key)) { PlayerPrefs.SetString(key, input); } } else if (type == ValueType.Int) { EditorGUILayout.LabelField("int", new GUILayoutOption[] { GUILayout.Width(40), }); int input = EditorGUILayout.DelayedIntField(key, PlayerPrefs.GetInt(key)); if (input != PlayerPrefs.GetInt(key)) { PlayerPrefs.SetInt(key, input); } } else if (type == ValueType.Float) { EditorGUILayout.LabelField("float", new GUILayoutOption[] { GUILayout.Width(40), }); float input = EditorGUILayout.DelayedFloatField(key, PlayerPrefs.GetFloat(key)); if (input != PlayerPrefs.GetFloat(key)) { PlayerPrefs.SetFloat(key, input); } } else { EditorGUILayout.TextField(key, "Unknown Type"); } if (GUILayout.Button("Delete", new GUILayoutOption[] { GUILayout.Width(80), })) { PlayerPrefs.DeleteKey(key); Refresh(); } EditorGUILayout.EndHorizontal(); } if (GUILayout.Button("Delete All")) { PlayerPrefs.DeleteAll(); Refresh(); } EditorGUILayout.EndScrollView(); #else EditorGUILayout.HelpBox("Platform Not Supported", MessageType.Error); #endif }