Skip to content

Fix update/switch and restart prompt on Unity 2020.2+ #1246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
FIX: Formatting.
  • Loading branch information
Rene Damm committed Dec 2, 2020
commit 0615c300243a3cbbb83686776c752aa9dd1778bf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private enum InputHandler

private static (bool newSystemEnabled, bool oldSystemEnabled) ActiveInputHandlerToTuple(int value)
{
switch ((InputHandler) value)
switch ((InputHandler)value)
{
case InputHandler.OldInputManager:
return (false, true);
Expand All @@ -130,11 +130,11 @@ private static int TupleToActiveInputHandler((bool newSystemEnabled, bool oldSys
switch (tuple)
{
case (false, true):
return (int) InputHandler.OldInputManager;
return (int)InputHandler.OldInputManager;
case (true, false):
return (int) InputHandler.NewInputSystem;
return (int)InputHandler.NewInputSystem;
case (true, true):
return (int) InputHandler.InputBoth;
return (int)InputHandler.InputBoth;
// Special case, when using two separate bool's of the public API here,
// it's possible to end up with both settings in false, for example:
// - EditorPlayerSettingHelpers.newSystemBackendsEnabled = true;
Expand All @@ -143,9 +143,10 @@ private static int TupleToActiveInputHandler((bool newSystemEnabled, bool oldSys
// - EditorPlayerSettingHelpers.oldSystemBackendsEnabled = true;
// On line 3 both settings will be false, even if we set old system to true on line 4.
case (false, false):
return (int) InputHandler.OldInputManager;
return (int)InputHandler.OldInputManager;
}
}

#else
private const string kEnableNewSystemProperty = "enableNativePlatformBackendsForNewInputSystem";
private const string kDisableOldSystemProperty = "disableOldInputManagerSupport";
Expand All @@ -161,4 +162,4 @@ private static SerializedProperty GetPropertyOrNull(string name)
}
}
}
#endif // UNITY_EDITOR
#endif // UNITY_EDITOR