Skip to content

Commit 975e589

Browse files
authored
FIX: Fixed a bug where the Input Settings Window might throw exceptio… (#885)
1 parent 9fe8744 commit 975e589

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Assets/Tests/InputSystem/CoreTests_Editor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public void Editor_PackageVersionAndAssemblyVersionAreTheSame()
3939

4040
// Snip -preview off the end. System.Version doesn't support semantic versioning.
4141
var versionString = packageJson.version;
42-
if (versionString.EndsWith("-preview"))
43-
versionString = versionString.Substring(0, versionString.Length - "-preview".Length);
42+
if (versionString.Contains("-preview"))
43+
versionString = versionString.Substring(0, versionString.IndexOf("-preview"));
4444
var version = new Version(versionString);
4545

4646
Assert.That(InputSystem.version.Major, Is.EqualTo(version.Major));

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
Due to package verification, the latest version below is the unpublished version and the date is meaningless.
88
however, it has to be formatted properly to pass verification tests.
99

10+
## [1.0.0-preview.1] - 2999-9-20
11+
12+
### Fixed
13+
14+
- Fixed a bug where the Input Settings Window might throw exceptions after assembly reload.
15+
1016
## [1.0.0-preview] - 2019-9-20
1117

1218
### Fixed

Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEditor;
66
using UnityEditorInternal;
77
using UnityEngine.InputSystem.Utilities;
8+
using UnityEngine.UIElements;
89

910
////TODO: detect if new input backends are enabled and put UI in here to enable them if needed
1011

@@ -33,10 +34,20 @@ private InputSettingsProvider(string path, SettingsScope scopes)
3334
{
3435
label = "Input System Package";
3536
s_Instance = this;
37+
}
3638

39+
public override void OnActivate(string searchContext, VisualElement rootElement)
40+
{
41+
base.OnActivate(searchContext, rootElement);
3742
InputSystem.onSettingsChange += OnSettingsChange;
3843
}
3944

45+
public override void OnDeactivate()
46+
{
47+
base.OnDeactivate();
48+
InputSystem.onSettingsChange -= OnSettingsChange;
49+
}
50+
4051
public void Dispose()
4152
{
4253
m_SettingsObject?.Dispose();

Packages/com.unity.inputsystem/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.inputsystem",
33
"displayName": "Input System",
4-
"version": "1.0.0-preview",
4+
"version": "1.0.0-preview.1",
55
"unity": "2019.1",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
 (0)