@@ -19,6 +19,9 @@ internal class InputActionImporterEditor : ScriptedImporterEditor
1919 public override VisualElement CreateInspectorGUI ( )
2020 {
2121 var root = new VisualElement ( ) ;
22+ root . styleSheets . Add ( AssetDatabase . LoadAssetAtPath < StyleSheet > (
23+ InputActionsEditorConstants . PackagePath +
24+ "/InputSystem/Editor/AssetImporter/InputActionImporterEditor.uss" ) ) ;
2225 var inputActionAsset = GetAsset ( ) ;
2326
2427 // ScriptedImporterEditor in 2019.2 now requires explicitly updating the SerializedObject
@@ -36,15 +39,12 @@ public override VisualElement CreateInspectorGUI()
3639 {
3740 text = GetOpenEditorButtonText ( inputActionAsset )
3841 } ;
39- editButton . style . height = 30 ;
40- editButton . style . marginTop = 4 ;
41- editButton . style . marginBottom = 4 ;
42+ editButton . AddToClassList ( "input-action-importer-editor__edit-button" ) ;
4243 editButton . SetEnabled ( inputActionAsset != null ) ;
4344 root . Add ( editButton ) ;
4445
4546 var projectWideContainer = new VisualElement ( ) ;
46- projectWideContainer . style . marginTop = 6 ;
47- projectWideContainer . style . marginBottom = 6 ;
47+ projectWideContainer . AddToClassList ( "input-action-importer-editor__project-wide-container" ) ;
4848 root . Add ( projectWideContainer ) ;
4949 BuildProjectWideSection ( projectWideContainer , inputActionAsset ) ;
5050
@@ -113,12 +113,11 @@ private void BuildCodeGenerationSection(VisualElement root, InputActionAsset inp
113113 }
114114
115115 var pathRow = new VisualElement ( ) ;
116- pathRow . style . flexDirection = FlexDirection . Row ;
117- pathRow . style . alignItems = Align . Center ;
116+ pathRow . AddToClassList ( "input-action-importer-editor__path-row" ) ;
118117 codeGenContainer . Add ( pathRow ) ;
119118
120119 var pathField = new TextField ( "C# Class File" ) { bindingPath = "m_WrapperCodePath" } ;
121- pathField . style . flexGrow = 1 ;
120+ pathField . AddToClassList ( "input-action-importer-editor__path-field" ) ;
122121 pathField . AddToClassList ( BaseField < string > . alignedFieldUssClassName ) ;
123122 SetupPlaceholder ( pathField , defaultFileName ) ;
124123 pathRow . Add ( pathField ) ;
@@ -141,7 +140,7 @@ private void BuildCodeGenerationSection(VisualElement root, InputActionAsset inp
141140 {
142141 text = "…"
143142 } ;
144- browseButton . style . width = 25 ;
143+ browseButton . AddToClassList ( "input-action-importer-editor__browse-button" ) ;
145144 pathRow . Add ( browseButton ) ;
146145
147146 // Class name
@@ -204,9 +203,7 @@ private static void SetupPlaceholder(TextField textField, string placeholder)
204203
205204 var placeholderLabel = new Label ( placeholder ) ;
206205 placeholderLabel . pickingMode = PickingMode . Ignore ;
207- placeholderLabel . style . position = Position . Absolute ;
208- placeholderLabel . style . opacity = 0.5f ;
209- placeholderLabel . style . paddingLeft = 2 ;
206+ placeholderLabel . AddToClassList ( "input-action-importer-editor__placeholder" ) ;
210207
211208 textField . RegisterCallback < GeometryChangedEvent > ( _ =>
212209 {
0 commit comments