jp.keijiro.klutter-tools 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,8 +40,7 @@ public static class VfxGraphTextEditorModifier
40
40
 
41
41
  #region Font application logic
42
42
 
43
- static readonly string TextClassName
44
- = "unity-text-element--inner-input-field-component";
43
+ static readonly string TextClassName = "unity-text-field__input";
45
44
 
46
45
  static Font _font;
47
46
 
@@ -52,16 +51,23 @@ public static class VfxGraphTextEditorModifier
52
51
  {
53
52
  if (!Preferences.VfxGraphChangeFont) return;
54
53
 
55
- var element = window.rootVisualElement.Q(className: TextClassName);
56
- if (element == null) return;
54
+ var root = window.rootVisualElement;
55
+ var elements = root.Query(className: TextClassName).ToList();
56
+ if (elements.Count == 0) return;
57
57
 
58
58
  if (_font == null)
59
59
  _font = Font.CreateDynamicFontFromOSFont
60
60
  (new[]{"Courier New"}, Preferences.VfxGraphFontSize);
61
61
 
62
- element.style.unityFontDefinition = StyleKeyword.None;
63
- element.style.unityFont = new StyleFont(_font);
64
- element.style.fontSize = Preferences.VfxGraphFontSize;
62
+ var unityFont = new StyleFont(_font);
63
+
64
+ foreach (var element in elements)
65
+ {
66
+ element.style.unityFontDefinition = StyleKeyword.None;
67
+ element.style.unityFont = unityFont;
68
+ element.style.fontSize = Preferences.VfxGraphFontSize;
69
+ element.style.whiteSpace = WhiteSpace.Normal;
70
+ }
65
71
  }
66
72
 
67
73
  static void CheckAndApplyCustomFont(EditorWindow window)
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Keijiro Takahashi",
6
6
  "license": "Unlicense",
7
7
  "dependencies": { },
8
- "version": "2.4.0",
8
+ "version": "2.4.2",
9
9
  "unity": "6000.0",
10
10
  "keywords": [ "unity" ]
11
11
  }