@@ -19,12 +19,9 @@ internal class InputActionImporterEditor : ScriptedImporterEditor
1919 public override VisualElement CreateInspectorGUI ( )
2020 {
2121 var root = new VisualElement ( ) ;
22- < << << << input / uitoolkit - input - asset
23- == = == ==
2422 root . styleSheets . Add ( AssetDatabase . LoadAssetAtPath < StyleSheet > (
2523 InputActionsEditorConstants . PackagePath +
2624 "/InputSystem/Editor/AssetImporter/InputActionImporterEditor.uss" ) ) ;
27- >>> > >>> develop
2825 var inputActionAsset = GetAsset ( ) ;
2926
3027 // ScriptedImporterEditor in 2019.2 now requires explicitly updating the SerializedObject
@@ -37,32 +34,16 @@ public override VisualElement CreateInspectorGUI()
3734 "The currently selected object is not an editable input action asset." ,
3835 HelpBoxMessageType . Info ) ) ;
3936 }
40- << < << < < input / uitoolkit - input - asset
41-
42- == = == ==
43-
44- >>> > >>> develop
4537 var editButton = new Button ( ( ) => OpenEditor ( inputActionAsset ) )
4638 {
4739 text = GetOpenEditorButtonText ( inputActionAsset )
4840 } ;
49- << < << < < input / uitoolkit - input - asset
50- editButton. style . height = 30 ;
51- editButton. style . marginTop = 4 ;
52- editButton. style . marginBottom = 4 ;
53- == = == ==
5441 editButton . AddToClassList ( "input-action-importer-editor__edit-button" ) ;
55- >>> > >>> develop
5642 editButton . SetEnabled ( inputActionAsset != null ) ;
5743 root . Add ( editButton ) ;
5844
5945 var projectWideContainer = new VisualElement ( ) ;
60- << < << < < input / uitoolkit - input - asset
61- projectWideContainer. style . marginTop = 6 ;
62- projectWideContainer. style . marginBottom = 6 ;
63- == = == ==
6446 projectWideContainer . AddToClassList ( "input-action-importer-editor__project-wide-container" ) ;
65- >>> > >>> develop
6647 root . Add ( projectWideContainer ) ;
6748 BuildProjectWideSection ( projectWideContainer , inputActionAsset ) ;
6849
@@ -80,56 +61,13 @@ public override VisualElement CreateInspectorGUI()
8061 private void BuildProjectWideSection ( VisualElement container , InputActionAsset inputActionAsset )
8162 {
8263 container . Clear ( ) ;
83- << < << < < input / uitoolkit - input - asset
84-
85- var currentActions = InputSystem. actions;
86-
87- == == == =
88-
8964 var currentActions = InputSystem . actions ;
90-
91- >>> >>> > develop
9265 if ( currentActions == inputActionAsset )
9366 {
9467 container . Add ( new HelpBox (
9568 "These actions are assigned as the Project-wide Input Actions." ,
9669 HelpBoxMessageType . Info ) ) ;
9770 return ;
98- << < << < < input / uitoolkit - input - asset
99- }
100-
101- var message = "These actions are not assigned as the Project-wide Input Actions for the Input System." ;
102- if ( currentActions != null )
103- {
104- var currentPath = AssetDatabase. GetAssetPath( currentActions ) ;
105- if ( ! string . IsNullOrEmpty ( currentPath ) )
106- message += $ " The actions currently assigned as the Project-wide Input Actions are: { currentPath } . ";
107- }
108-
109- container. Add ( new HelpBox ( message , HelpBoxMessageType . Warning ) ) ;
110-
111- var assignButton = new Button ( ( ) =>
112- {
113- InputSystem . actions = inputActionAsset ;
114- BuildProjectWideSection ( container , inputActionAsset ) ;
115- } )
116- {
117- text = "Assign as the Project-wide Input Actions"
118- } ;
119- assignButton. SetEnabled ( ! EditorApplication . isPlayingOrWillChangePlaymode ) ;
120- container. Add ( assignButton ) ;
121- }
122-
123- private void BuildCodeGenerationSection( VisualElement root , InputActionAsset inputActionAsset )
124- {
125- var generateField = new PropertyField(
126- serializedObject . FindProperty ( "m_GenerateWrapperCode" ) , "Generate C# Class" ) ;
127- root. Add ( generateField ) ;
128-
129- var codeGenContainer = new VisualElement( ) ;
130- root. Add ( codeGenContainer ) ;
131-
132- == = == ==
13371 }
13472
13573 var message = "These actions are not assigned as the Project-wide Input Actions for the Input System." ;
@@ -164,7 +102,6 @@ private void BuildCodeGenerationSection(VisualElement root, InputActionAsset inp
164102 var codeGenContainer = new VisualElement ( ) ;
165103 root . Add ( codeGenContainer ) ;
166104
167- >>> > >>> develop
168105 // File path with browse button
169106 string defaultFileName = "" ;
170107 if ( inputActionAsset != null )
@@ -174,20 +111,11 @@ private void BuildCodeGenerationSection(VisualElement root, InputActionAsset inp
174111 }
175112
176113 var pathRow = new VisualElement ( ) ;
177- << < << < < input / uitoolkit - input - asset
178- pathRow. style . flexDirection = FlexDirection . Row ;
179- pathRow. style . alignItems = Align . Center ;
180- codeGenContainer. Add ( pathRow ) ;
181-
182- var pathField = new TextField ( "C# Class File" ) { bindingPath = "m_WrapperCodePath" } ;
183- pathField . style . flexGrow = 1 ;
184- == = == ==
185114 pathRow . AddToClassList ( "input-action-importer-editor__path-row" ) ;
186115 codeGenContainer . Add ( pathRow ) ;
187116
188117 var pathField = new TextField ( "C# Class File" ) { bindingPath = "m_WrapperCodePath" } ;
189118 pathField . AddToClassList ( "input-action-importer-editor__path-field" ) ;
190- >>> > >>> develop
191119 pathField . AddToClassList ( BaseField < string > . alignedFieldUssClassName ) ;
192120 SetupPlaceholder ( pathField , defaultFileName ) ;
193121 pathRow . Add ( pathField ) ;
@@ -210,12 +138,7 @@ private void BuildCodeGenerationSection(VisualElement root, InputActionAsset inp
210138 {
211139 text = "…"
212140 } ;
213- << < << < < input / uitoolkit - input - asset
214- browseButton. style . width = 25 ;
215- browseButton. style . minWidth = 25 ;
216- == = == ==
217141 browseButton . AddToClassList ( "input-action-importer-editor__browse-button" ) ;
218- >>> > >>> develop
219142 pathRow . Add ( browseButton ) ;
220143
221144 // Class name
@@ -278,14 +201,7 @@ private static void SetupPlaceholder(TextField textField, string placeholder)
278201
279202 var placeholderLabel = new Label ( placeholder ) ;
280203 placeholderLabel . pickingMode = PickingMode . Ignore ;
281- << < << < < input / uitoolkit - input - asset
282- placeholderLabel. style . position = Position . Absolute ;
283- placeholderLabel. style . unityTextAlign = TextAnchor . MiddleLeft ;
284- placeholderLabel. style . opacity = 0.5f ;
285- placeholderLabel. style . paddingLeft = 2 ;
286- == = == ==
287204 placeholderLabel . AddToClassList ( "input-action-importer-editor__placeholder" ) ;
288- >>> > >>> develop
289205
290206 textField . RegisterCallback < GeometryChangedEvent > ( _ =>
291207 {
0 commit comments