Skip to content

Commit 9527bf5

Browse files
author
Rene Damm
authored
FIX: Replace StandaloneInputModule button not dirtying scene (#999).
1 parent 62ca4ef commit 9527bf5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ This release includes a number of Quality-of-Life improvements for a range of co
8787
- Removing a device no longer has the potential of corrupting state change monitors (and thus actions getting triggered) from other devices.
8888
* This bug led to input being missed on a device once another device had been removed.
8989

90+
#### Actions
91+
92+
- Clicking the "Replace with InputSystemUIInputModule" button in the inspector when looking at `StandaloneInputModule`, the resulting operation is now undoable and will properly dirty the scene.
93+
9094
## [1.0.0-preview.3] - 2019-11-14
9195

9296
### Fixed

Packages/com.unity.inputsystem/InputSystem/Plugins/UI/StandaloneInputModuleEditor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ public override void OnInspectorGUI()
3636
EditorGUILayout.HelpBox("You are using StandaloneInputModule, which uses the old InputManager. You also have the new InputSystem enabled in your project. Click the button below to replace this component with a InputSystemUIInputModule, which uses the new InputSystem (recommended).", MessageType.Info);
3737
if (GUILayout.Button("Replace with InputSystemUIInputModule"))
3838
{
39-
((StandaloneInputModule)target).gameObject.AddComponent<InputSystemUIInputModule>();
40-
DestroyImmediate(target);
39+
var go = ((StandaloneInputModule)target).gameObject;
40+
Undo.DestroyObjectImmediate(target);
41+
Undo.AddComponent<InputSystemUIInputModule>(go);
4142
return;
4243
}
4344
GUILayout.Space(10);

0 commit comments

Comments
 (0)